美文网首页
去除Update更新操作

去除Update更新操作

作者: 发条蛙 | 来源:发表于2017-10-23 20:03 被阅读0次

Update页面

首次启动时一闪而过的Update页面对应的HTML文件为oobe_update.html

<dom-module id="oobe-update-md">
  <template>
    <link rel="stylesheet" href="oobe_update.css">
    <link rel="stylesheet" href="oobe_dialog_parameters.css">
    <oobe-dialog hidden="[[!checkingForUpdate]]" tabindex="0"
        aria-live="polite">
      <iron-icon icon="oobe-update:googleg" class="oobe-icon"></iron-icon>
      <div class="header">
        <h1 class="title" i18n-content="checkingForUpdates"></h1>
        <div class="subtitle" id="checkingForUpdateCancelHint"
            i18n-content="cancelUpdateHint" hidden="[[!cancelAllowed]]">
        </div>
      </div>
      <div class="footer flex layout vertical">
        <paper-progress id="checking-progress" indeterminate></paper-progress>
      </div>
    </oobe-dialog>
    <oobe-dialog hidden="[[checkingForUpdate]]" tabindex="0"
        aria-live="polite">
      <iron-icon icon="oobe-update:googleg" class="oobe-icon"></iron-icon>
      <div class="header">
        <h1 class="title" i18n-content="updatingScreenTitle"></h1>
        <div class="subtitle" i18n-content="installingUpdateDesc"></div>
        <div class="subtitle" id="updatingCancelHint"
            i18n-content="cancelUpdateHint" hidden="[[!cancelAllowed]]">
        </div>
      </div>
      <div class="footer flex layout vertical">
        <div id="update-upper-label">[[updateUpperLabel]]</div>
        <paper-progress min="0" max="100" value="[[progressValue]]">
        </paper-progress>
        <div id="estimated-time-left" class="progress-message"
            hidden="[[!estimatedTimeLeftShown]]">[[estimatedTimeLeft]]</div>
        <div id="progress-message" class="progress-message"
            hidden="[[!progressMessageShown]]">[[progressMessage]]</div>
      </div>
    </oobe-dialog>
  </template>
</dom-module>

显示Update页面

是在当网络连接之后唤醒的,其唤醒流程如下所示:


显示更新页面

终止Update的操作

在UPdate页面显示的过程中可以通过Esc来终止该操作,按下Esc后的流程如下所示:

终止页面更新

去除Update更新操作

根据以上的描述,要去除Update操作,最合适的位置为在文件/src/chrome/browser/chromeos/login/wizard_controller.cc中的函数StartOOBEUpdate()内进行修改,将函数:

void WizardController::StartOOBEUpdate() {
  VLOG(1) << "StartOOBEUpdate";
  SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true);
  UpdateScreen::Get(screen_manager())->StartNetworkCheck();
}

修改为:

void WizardController::StartOOBEUpdate() {
  VLOG(1) << "StartOOBEUpdate";
  SetCurrentScreenSmooth(GetScreen(OobeScreen::SCREEN_OOBE_UPDATE), true);
  UpdateScreen::Get(screen_manager())->CancelUpdate();
}

这样既可跳过初次启动时的Update更新操作。

相关文章

网友评论

      本文标题:去除Update更新操作

      本文链接:https://www.haomeiwen.com/subject/olaauxtx.html