diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-03-08 13:07:32 +0100 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2018-03-08 13:40:10 +0000 |
commit | 818d9aed569afd192f6d4f6d9b28b72912df8b93 (patch) | |
tree | fa30cbdffa3e8fdc09dbbe37ffc0a721b40fced1 /chromium/chrome/browser | |
parent | 66a2147d838e293f4a5db7711c8eba4e6faaaf0f (diff) | |
download | qtwebengine-chromium-818d9aed569afd192f6d4f6d9b28b72912df8b93.tar.gz |
BASELINE: Update Chromium to 65.0.3325.151
Change-Id: I3c71dd500483eb29491ac3eee4123714dda52da9
Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'chromium/chrome/browser')
30 files changed, 348 insertions, 49 deletions
diff --git a/chromium/chrome/browser/printing/pdf_to_emf_converter.cc b/chromium/chrome/browser/printing/pdf_to_emf_converter.cc index b2e4d2bbd79..358341995d0 100644 --- a/chromium/chrome/browser/printing/pdf_to_emf_converter.cc +++ b/chromium/chrome/browser/printing/pdf_to_emf_converter.cc @@ -212,6 +212,14 @@ class PdfConverterImpl : public PdfConverter { StartCallback start_callback); ~PdfConverterImpl() override; + static void set_fail_when_creating_temp_file_for_tests(bool fail) { + simulate_failure_creating_temp_file_ = fail; + } + + static bool fail_when_creating_temp_file_for_tests() { + return simulate_failure_creating_temp_file_; + } + private: class GetPageCallbackData { public: @@ -287,9 +295,14 @@ class PdfConverterImpl : public PdfConverter { base::WeakPtrFactory<PdfConverterImpl> weak_ptr_factory_; + static bool simulate_failure_creating_temp_file_; + DISALLOW_COPY_AND_ASSIGN(PdfConverterImpl); }; +// static +bool PdfConverterImpl::simulate_failure_creating_temp_file_ = false; + std::unique_ptr<MetafilePlayer> PdfConverterImpl::GetFileFromTemp( ScopedTempFile temp_file) { if (settings_.mode == PdfRenderSettings::Mode::POSTSCRIPT_LEVEL2 || @@ -302,6 +315,9 @@ std::unique_ptr<MetafilePlayer> PdfConverterImpl::GetFileFromTemp( } ScopedTempFile CreateTempFile(scoped_refptr<RefCountedTempDir>* temp_dir) { + if (PdfConverterImpl::fail_when_creating_temp_file_for_tests()) + return ScopedTempFile(); + if (!temp_dir->get()) *temp_dir = base::MakeRefCounted<RefCountedTempDir>(); ScopedTempFile file; @@ -540,7 +556,7 @@ void PdfConverterImpl::OnFailed(const std::string& error_message) { LOG(ERROR) << "Failed to convert PDF: " << error_message; base::WeakPtr<PdfConverterImpl> weak_this = weak_ptr_factory_.GetWeakPtr(); if (!start_callback_.is_null()) { - OnPageCount(mojom::PdfToEmfConverterPtr(), 0); + std::move(start_callback_).Run(/*page_count=*/0); if (!weak_this) return; // Protect against the |start_callback_| deleting |this|. } @@ -570,4 +586,14 @@ std::unique_ptr<PdfConverter> PdfConverter::StartPdfConverter( std::move(start_callback)); } +ScopedSimulateFailureCreatingTempFileForTests:: + ScopedSimulateFailureCreatingTempFileForTests() { + PdfConverterImpl::set_fail_when_creating_temp_file_for_tests(true); +} + +ScopedSimulateFailureCreatingTempFileForTests:: + ~ScopedSimulateFailureCreatingTempFileForTests() { + PdfConverterImpl::set_fail_when_creating_temp_file_for_tests(false); +} + } // namespace printing diff --git a/chromium/chrome/browser/printing/pdf_to_emf_converter.h b/chromium/chrome/browser/printing/pdf_to_emf_converter.h index 1263c44001a..5aa61f7a2b0 100644 --- a/chromium/chrome/browser/printing/pdf_to_emf_converter.h +++ b/chromium/chrome/browser/printing/pdf_to_emf_converter.h @@ -38,6 +38,16 @@ class PdfConverter { virtual void GetPage(int page_number, const GetPageCallback& get_page_callback) = 0; }; + +// Object used by tests to exercise the temporary file creation failure code +// path. As long as this object is alive, the PdfConverter will fail when +// creating temporary files. +class ScopedSimulateFailureCreatingTempFileForTests { + public: + ScopedSimulateFailureCreatingTempFileForTests(); + ~ScopedSimulateFailureCreatingTempFileForTests(); +}; + } // namespace printing #endif // CHROME_BROWSER_PRINTING_PDF_TO_EMF_CONVERTER_H_ diff --git a/chromium/chrome/browser/printing/pdf_to_emf_converter_browsertest.cc b/chromium/chrome/browser/printing/pdf_to_emf_converter_browsertest.cc index bcd515a4e01..c0ab2f79d47 100644 --- a/chromium/chrome/browser/printing/pdf_to_emf_converter_browsertest.cc +++ b/chromium/chrome/browser/printing/pdf_to_emf_converter_browsertest.cc @@ -79,7 +79,19 @@ void CompareEMFHeaders(const ENHMETAHEADER& expected_header, } // namespace -IN_PROC_BROWSER_TEST_F(PDFToEMFConverterBrowserTest, TestFailure) { +IN_PROC_BROWSER_TEST_F(PDFToEMFConverterBrowserTest, TestFailureNoTempFile) { + ScopedSimulateFailureCreatingTempFileForTests fail_creating_temp_file; + + base::RunLoop run_loop; + int page_count = -1; + std::unique_ptr<PdfConverter> pdf_converter = PdfConverter::StartPdfConverter( + base::MakeRefCounted<base::RefCountedStaticMemory>(), PdfRenderSettings(), + base::Bind(&StartCallbackImpl, run_loop.QuitClosure(), &page_count)); + run_loop.Run(); + EXPECT_EQ(0, page_count); +} + +IN_PROC_BROWSER_TEST_F(PDFToEMFConverterBrowserTest, TestFailureBadPdf) { scoped_refptr<base::RefCountedStaticMemory> bad_pdf_data = base::MakeRefCounted<base::RefCountedStaticMemory>("0123456789", 10); diff --git a/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json b/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json index 3478c1cc9d3..456a43640de 100644 --- a/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json +++ b/chromium/chrome/browser/resources/chromeos/zip_archiver/manifest.json @@ -22,7 +22,8 @@ "directory" ] }, - "notifications" + "notifications", + "storage" ], "file_system_provider_capabilities": { "multipleMounts": true, diff --git a/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json b/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json index 99b6cf673f3..9d4b50b6b41 100644 --- a/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json +++ b/chromium/chrome/browser/resources/plugin_metadata/plugins_linux.json @@ -1,5 +1,5 @@ { - "x-version": 26, + "x-version": 28, "google-talk": { "mime_types": [ ], @@ -80,9 +80,9 @@ ], "versions": [ { - "version": "27.0.0.187", + "version": "28.0.0.161", "status": "up_to_date", - "reference": "https://helpx.adobe.com/security/products/flash-player/apsb17-33.html" + "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-03.html" } ], "lang": "en-US", diff --git a/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json b/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json index a85342825f9..5a7f063708f 100644 --- a/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json +++ b/chromium/chrome/browser/resources/plugin_metadata/plugins_mac.json @@ -1,5 +1,5 @@ { - "x-version": 32, + "x-version": 34, "google-talk": { "mime_types": [ ], @@ -115,9 +115,9 @@ ], "versions": [ { - "version": "27.0.0.187", + "version": "28.0.0.161", "status": "requires_authorization", - "reference": "https://helpx.adobe.com/security/products/flash-player/apsb17-33.html" + "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-03.html" } ], "lang": "en-US", diff --git a/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json b/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json index c5b325b08c2..4d356b256f0 100644 --- a/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json +++ b/chromium/chrome/browser/resources/plugin_metadata/plugins_win.json @@ -1,5 +1,5 @@ { - "x-version": 41, + "x-version": 43, "google-talk": { "mime_types": [ ], @@ -137,9 +137,9 @@ ], "versions": [ { - "version": "27.0.0.187", + "version": "28.0.0.161", "status": "requires_authorization", - "reference": "https://helpx.adobe.com/security/products/flash-player/apsb17-33.html" + "reference": "https://helpx.adobe.com/security/products/flash-player/apsb18-03.html" } ], "lang": "en-US", diff --git a/chromium/chrome/browser/resources/print_preview/print_preview.js b/chromium/chrome/browser/resources/print_preview/print_preview.js index 0a8f1d34329..918f2ad7db4 100644 --- a/chromium/chrome/browser/resources/print_preview/print_preview.js +++ b/chromium/chrome/browser/resources/print_preview/print_preview.js @@ -566,7 +566,8 @@ cr.define('print_preview', function() { } const destination = assert(this.destinationStore_.selectedDestination); const whenPrintDone = this.sendPrintRequest_(destination); - if (destination.isLocal) { + if (destination.isLocal || + this.uiState_ == PrintPreviewUiState_.OPENING_PDF_PREVIEW) { const onError = destination.id == print_preview.Destination.GooglePromotedId.SAVE_AS_PDF ? this.onFileSelectionCancel_.bind(this) : diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.html b/chromium/chrome/browser/resources/settings/about_page/about_page.html index 42a110c6acf..4f2f097bbe7 100644 --- a/chromium/chrome/browser/resources/settings/about_page/about_page.html +++ b/chromium/chrome/browser/resources/settings/about_page/about_page.html @@ -96,12 +96,22 @@ </div> <div class="settings-box two-line"> <!-- TODO(dpapad): Investigate why vulcanize does not handle well - a new line after "getIconSrc_(", causes incorrect src URL --> + a new line after "getThrobberSrcIfUpdating_(", causes incorrect + src URL --> + <!-- Set the icon from the iconset (when it's obsolete/EOL and + when update is done) or set the src (when it's updating). --> <iron-icon - hidden="[[!showUpdateStatus_]]" - icon$="[[getIcon_( + hidden="[[!shouldShowIcons_(showUpdateStatus_)]]" +<if expr="not chromeos"> + icon$="[[getUpdateStatusIcon_( obsoleteSystemInfo_, currentUpdateStatusEvent_)]]" - src="[[getIconSrc_(obsoleteSystemInfo_, currentUpdateStatusEvent_)]]"> + src="[[getThrobberSrcIfUpdating_(obsoleteSystemInfo_, currentUpdateStatusEvent_)]]"> +</if> +<if expr="chromeos"> + icon$="[[getUpdateStatusIcon_( + hasEndOfLife_, currentUpdateStatusEvent_)]]" + src="[[getThrobberSrcIfUpdating_(hasEndOfLife_, currentUpdateStatusEvent_)]]"> +</if> </iron-icon> <div class="start padded"> <div id="updateStatusMessage" hidden="[[!showUpdateStatus_]]"> @@ -121,6 +131,7 @@ $i18n{learnMore} </a> </div> +<if expr="not chromeos"> <span id="deprecationWarning" hidden="[[!obsoleteSystemInfo_.obsolete]]"> $i18n{aboutObsoleteSystem} @@ -128,6 +139,15 @@ $i18n{learnMore} </a> </span> +</if> +<if expr="chromeos"> + <div id="endOfLifeMessageContainer" hidden="[[!hasEndOfLife_]]"> + $i18n{endOfLifeMessage} + <a href="$i18n{endOfLifeLearnMoreURL}" target="_blank"> + $i18n{learnMore} + </a> + </div> +</if> <div class="secondary">$i18n{aboutBrowserVersion}</div> </div> <div class="separator" hidden="[[!showButtonContainer_]]"></div> diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page.js b/chromium/chrome/browser/resources/settings/about_page/about_page.js index beecac15534..d2dbea9b66e 100644 --- a/chromium/chrome/browser/resources/settings/about_page/about_page.js +++ b/chromium/chrome/browser/resources/settings/about_page/about_page.js @@ -34,6 +34,9 @@ Polymer({ /** @private {?RegulatoryInfo} */ regulatoryInfo_: Object, + + /** @private */ + hasEndOfLife_: Boolean, // </if> // <if expr="_google_chrome and is_macosx"> @@ -41,6 +44,7 @@ Polymer({ promoteUpdaterStatus_: Object, // </if> + // <if expr="not chromeos"> /** @private {!{obsolete: boolean, endOfLine: boolean}} */ obsoleteSystemInfo_: { type: Object, @@ -51,6 +55,7 @@ Polymer({ }; }, }, + // </if> /** @private */ showUpdateStatus_: Boolean, @@ -73,7 +78,7 @@ Polymer({ showCheckUpdates_: { type: Boolean, computed: 'computeShowCheckUpdates_(' + - 'currentUpdateStatusEvent_, hasCheckedForUpdates_)', + 'currentUpdateStatusEvent_, hasCheckedForUpdates_, hasEndOfLife_)', }, /** @private {!Map<string, string>} */ @@ -117,7 +122,7 @@ Polymer({ // <if expr="chromeos"> 'updateShowUpdateStatus_(' + - 'obsoleteSystemInfo_, currentUpdateStatusEvent_,' + + 'hasEndOfLife_, currentUpdateStatusEvent_,' + 'hasCheckedForUpdates_)', 'updateShowRelaunch_(currentUpdateStatusEvent_, targetChannel_,' + 'currentChannel_)', @@ -155,6 +160,10 @@ Polymer({ this.aboutBrowserProxy_.getRegulatoryInfo().then(info => { this.regulatoryInfo_ = info; }); + + this.aboutBrowserProxy_.getHasEndOfLife().then(result => { + this.hasEndOfLife_ = result; + }); // </if> // <if expr="not chromeos"> this.startListening_(); @@ -250,10 +259,22 @@ Polymer({ this.showUpdateStatus_ = false; return; } + + // Do not show "updated" status if the device is end of life. + if (this.hasEndOfLife_) { + this.showUpdateStatus_ = false; + return; + } + // </if> + + // <if expr="not chromeos"> + if (this.obsoleteSystemInfo_.endOfLine) { + this.showUpdateStatus_ = false; + return; + } // </if> this.showUpdateStatus_ = - this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED && - !this.obsoleteSystemInfo_.endOfLine; + this.currentUpdateStatusEvent_.status != UpdateStatus.DISABLED; }, /** @@ -353,11 +374,21 @@ Polymer({ * @return {?string} * @private */ - getIcon_: function() { + getUpdateStatusIcon_: function() { + // <if expr="chromeos"> + // If Chrome OS has reached end of life, display a special icon and + // ignore UpdateStatus. + if (this.hasEndOfLife_) { + return 'settings:end-of-life'; + } + // </if> + + // <if expr="not chromeos"> // If this platform has reached the end of the line, display an error icon // and ignore UpdateStatus. if (this.obsoleteSystemInfo_.endOfLine) return 'settings:error'; + // </if> switch (this.currentUpdateStatusEvent_.status) { case UpdateStatus.DISABLED_BY_ADMIN: @@ -376,9 +407,17 @@ Polymer({ * @return {?string} * @private */ - getIconSrc_: function() { + getThrobberSrcIfUpdating_: function() { + // <if expr="chromeos"> + if (this.hasEndOfLife_) { + return null; + } + // </if> + + // <if expr="not chromeos"> if (this.obsoleteSystemInfo_.endOfLine) return null; + // </if> switch (this.currentUpdateStatusEvent_.status) { case UpdateStatus.CHECKING: @@ -440,6 +479,11 @@ Polymer({ * @private */ computeShowCheckUpdates_: function() { + // Disable update button if the device is end of life. + if (this.hasEndOfLife_) { + return false; + } + // Enable the update button if we are in a stale 'updated' status or // update has failed. Disable it otherwise. const staleUpdatedStatus = @@ -501,4 +545,20 @@ Polymer({ this.aboutBrowserProxy_.openFeedbackDialog(); }, // </if> + + /** + * @return {boolean} + * @private + */ + shouldShowIcons_: function() { + // <if expr="chromeos"> + if (this.hasEndOfLife_) + return true; + // </if> + // <if expr="not chromeos"> + if (this.obsoleteSystemInfo_.endOfLine) + return true; + // </if> + return this.showUpdateStatus_; + }, }); diff --git a/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js b/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js index 78a656563a1..c074d7e2c16 100644 --- a/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js +++ b/chromium/chrome/browser/resources/settings/about_page/about_page_browser_proxy.js @@ -198,6 +198,13 @@ cr.define('settings', function() { getRegulatoryInfo() {} /** + * Checks if the device has reached end-of-life status and will no longer + * receive updates. + * @return {!Promise<boolean>} + */ + getHasEndOfLife() {} + + /** * Request TPM firmware update status from the browser. It results in one or * more 'tpm-firmware-update-status-changed' WebUI events. */ @@ -279,6 +286,11 @@ cr.define('settings', function() { } /** @override */ + getHasEndOfLife() { + return cr.sendWithPromise('getHasEndOfLife'); + } + + /** @override */ refreshTPMFirmwareUpdateStatus() { chrome.send('refreshTPMFirmwareUpdateStatus'); } diff --git a/chromium/chrome/browser/resources/settings/icons.html b/chromium/chrome/browser/resources/settings/icons.html index 5c035d852d8..c15dd7ba4a7 100644 --- a/chromium/chrome/browser/resources/settings/icons.html +++ b/chromium/chrome/browser/resources/settings/icons.html @@ -126,6 +126,7 @@ List icons here rather than importing large sets of (e.g. Polymer) icons. <g id="volume-up"><path d="M3 9v6h4l5 5V4L7 9H3zm13.5 3c0-1.77-1.02-3.29-2.5-4.03v8.05c1.48-.73 2.5-2.25 2.5-4.02zM14 3.23v2.06c2.89.86 5 3.54 5 6.71s-2.11 5.85-5 6.71v2.06c4.01-.91 7-4.49 7-8.77s-2.99-7.86-7-8.77z"></path></g> <if expr="chromeos"> <g id="warning"><path d="M1 21h22L12 2 1 21zm12-3h-2v-2h2v2zm0-4h-2v-4h2v4z"></path></g> + <g id="end-of-life"><path d="M4.574 2.916H4.55l.01.01.014-.01zM2.5 4.968v.023a.18.18 0 0 1 .01-.013l-.01-.01zm14.585 10.49v-.024l-.01.013.01.01zm.223 1.817l-.933-.95-4.106-4.11L8.026 7.99 3.675 3.635l-.942-.941-.712-.713L1 3.002l1.733 1.733A9.056 9.056 0 0 0 1.05 9.98c0 1.95.628 3.748 1.683 5.22.574.8 1.274 1.501 2.074 2.075a8.918 8.918 0 0 0 5.218 1.684 8.918 8.918 0 0 0 5.218-1.684L16.991 19l1.02-1.021-.703-.704zM15.243 2.684A8.922 8.922 0 0 0 10.025 1a8.922 8.922 0 0 0-5.218 1.684c-.005.003 4.135 4.16 4.135 4.16l1.083-1.814L15.042 11h-1.846l4.11 4.214a8.939 8.939 0 0 0 .011-10.456 9.021 9.021 0 0 0-2.074-2.074zM12 15H7.012v-3.989L4.5 11l2.227-1.876L12 14.6v.4z" fill="#DB4437" fill-rule="evenodd"></path></g> </if> <if expr="not chromeos"> <g id="web"><path d="M20 4H4c-1.1 0-1.99.9-1.99 2L2 18c0 1.1.9 2 2 2h16c1.1 0 2-.9 2-2V6c0-1.1-.9-2-2-2zm-5 14H4v-4h11v4zm0-5H4V9h11v4zm5 5h-4V9h4v9z"></path></g> diff --git a/chromium/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp b/chromium/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp index 7ffb7c767f7..cec4fe353b2 100644 --- a/chromium/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp +++ b/chromium/chrome/browser/resources/settings/internet_page/compiled_resources2.gyp @@ -37,6 +37,7 @@ '<(DEPTH)/ui/webui/resources/cr_elements/cr_dialog/compiled_resources2.gyp:cr_dialog', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:assert', '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:i18n_behavior', + '<(DEPTH)/ui/webui/resources/js/compiled_resources2.gyp:util', '<(EXTERNS_GYP):networking_private', '<(INTERFACES_GYP):networking_private_interface', ], diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_config.html b/chromium/chrome/browser/resources/settings/internet_page/internet_config.html index 22a7b87c97c..4fa0a79d5e8 100644 --- a/chromium/chrome/browser/resources/settings/internet_page/internet_config.html +++ b/chromium/chrome/browser/resources/settings/internet_page/internet_config.html @@ -14,6 +14,11 @@ dialog { width: 460px; } + + .error { + color: red; + font-weight: 500; + } </style> <dialog is="cr-dialog" id="dialog" close-text="$i18n{close}"> @@ -26,11 +31,15 @@ enable-connect="{{enableConnect_}}" enable-save="{{enableSave_}}" share-allow-enable="[[shareAllowEnable_]]" share-default="[[shareDefault_]]" + error="{{error_}}" on-close="close"> </network-config> </div> - <div slot="button-container"> + <div class="layout horizontal center" slot="button-container"> + <template is="dom-if" if="[[error_]]" restamp> + <div class="flex error">[[getError_(error_)]]</div> + </template> <paper-button class="cancel-button" on-tap="onCancelTap_"> $i18n{cancel} </paper-button> diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_config.js b/chromium/chrome/browser/resources/settings/internet_page/internet_config.js index b77d68088b9..b6bda81171f 100644 --- a/chromium/chrome/browser/resources/settings/internet_page/internet_config.js +++ b/chromium/chrome/browser/resources/settings/internet_page/internet_config.js @@ -69,6 +69,15 @@ Polymer({ * @private {!chrome.networkingPrivate.NetworkProperties} */ networkProperties_: Object, + + /** + * Set by network-config when a configuration error occurs. + * @private + */ + error_: { + type: String, + value: '', + }, }, open: function() { @@ -100,12 +109,22 @@ Polymer({ getDialogTitle_: function() { const name = this.networkProperties_.Name; if (name) - return this.i18n('internetConfigName', name); + return this.i18n('internetConfigName', HTMLEscape(name)); const type = this.i18n('OncType' + this.networkProperties_.Type); return this.i18n('internetJoinType', type); }, /** + * @return {string} + * @private + */ + getError_: function() { + if (this.i18nExists(this.error_)) + return this.i18n(this.error_); + return this.i18n('networkErrorUnknown'); + }, + + /** * @return {boolean} * @private */ diff --git a/chromium/chrome/browser/resources/settings/internet_page/internet_page.js b/chromium/chrome/browser/resources/settings/internet_page/internet_page.js index b834ac31498..3b8126607c7 100644 --- a/chromium/chrome/browser/resources/settings/internet_page/internet_page.js +++ b/chromium/chrome/browser/resources/settings/internet_page/internet_page.js @@ -283,6 +283,10 @@ Polymer({ * @private */ showConfig_: function(type, guid, name) { + if (!loadTimeData.getBoolean('networkSettingsConfig')) { + chrome.send('configureNetwork', [guid]); + return; + } const configDialog = /** @type {!InternetConfigElement} */ (this.$.configDialog); configDialog.type = diff --git a/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js b/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js index 00a9bc025b7..a6bc7f9fef8 100644 --- a/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js +++ b/chromium/chrome/browser/resources/settings/internet_page/tether_connection_dialog.js @@ -138,7 +138,8 @@ Polymer({ */ getExplanation_: function(networkProperties) { return this.i18n( - 'tetherConnectionExplanation', CrOnc.getNetworkName(networkProperties)); + 'tetherConnectionExplanation', + CrOnc.getEscapedNetworkName(networkProperties)); }, /** @@ -149,7 +150,7 @@ Polymer({ getDescriptionTitle_: function(networkProperties) { return this.i18n( 'tetherConnectionDescriptionTitle', - CrOnc.getNetworkName(networkProperties)); + CrOnc.getEscapedNetworkName(networkProperties)); }, /** diff --git a/chromium/chrome/browser/resources/welcome/welcome_win10.html b/chromium/chrome/browser/resources/welcome/welcome_win10.html index a7003874889..84b8c28c5a0 100644 --- a/chromium/chrome/browser/resources/welcome/welcome_win10.html +++ b/chromium/chrome/browser/resources/welcome/welcome_win10.html @@ -8,9 +8,12 @@ <link rel="import" href="chrome://resources/cr_elements/icons.html"> <link rel="import" href="chrome://resources/html/cr.html"> + <link rel="import" href="chrome://resources/html/load_time_data.html"> + <link rel="import" href="chrome://resources/html/util.html"> + <link rel="import" href="chrome://resources/html/action_link.html"> <link rel="import" href="chrome://resources/html/action_link_css.html"> - <link rel="import" href="chrome://resources/html/util.html"> + <link rel="import" href="chrome://resources/polymer/v1_0/iron-icon/iron-icon.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-button/paper-button.html"> <link rel="import" href="chrome://resources/polymer/v1_0/paper-styles/color.html"> @@ -18,6 +21,8 @@ <link rel="stylesheet" href="chrome://resources/css/text_defaults_md.css"> <link rel="stylesheet" href="/welcome_win10.css"> + <script src="strings.js"></script> + <dom-module id="welcome-win10"> <template> <style include="action-link"> @@ -31,6 +36,10 @@ transition: opacity 300ms; } + :host(.accelerated) { + --expandable-section-height: 26.375em; + } + a { color: var(--google-blue-500); text-decoration: none; @@ -274,7 +283,7 @@ } </style> <div class="header-logo" role="presentation"></div> - <div class="heading">$i18n{headerText}</div> + <div class="heading" role="heading" aria-level="1">$i18n{headerText}</div> <div class="sections"> <div class$="[[computeClasses(isCombined)]]"> <template is="dom-if" if="[[isCombined]]"> diff --git a/chromium/chrome/browser/resources/welcome/welcome_win10.js b/chromium/chrome/browser/resources/welcome/welcome_win10.js index a961634a306..91a5bacbc42 100644 --- a/chromium/chrome/browser/resources/welcome/welcome_win10.js +++ b/chromium/chrome/browser/resources/welcome/welcome_win10.js @@ -31,18 +31,15 @@ Polymer({ ready: function() { this.isCombined = false; - this.isAccelerated = false; + this.isAccelerated = loadTimeData.getBoolean('accelerated_flow_enabled'); + // The accelerated flow can be overridden with a query parameter. const FLOWTYPE_KEY = 'flowtype'; const FLOW_TYPE_MAP = {'regular': false, 'accelerated': true}; var params = new URLSearchParams(location.search); if (params.has(FLOWTYPE_KEY)) { if (params.get(FLOWTYPE_KEY) in FLOW_TYPE_MAP) { this.isAccelerated = FLOW_TYPE_MAP[params.get(FLOWTYPE_KEY)]; - - // Adjust the height since the accelerated flow contains fewer steps. - this.customStyle['--expandable-section-height'] = '26.375em'; - this.updateStyles(); } else { console.log( 'Found invalid value for the \'flowtype\' parameter: %s', @@ -50,6 +47,10 @@ Polymer({ } } + // The accelerated flow contains fewer steps. To account for this, toggle + // the 'accelerated' class which reduces the height of the steps section. + this.classList.toggle('accelerated', this.isAccelerated); + // Asynchronously check if Chrome is pinned to the taskbar. cr.sendWithPromise('getPinnedToTaskbarState') .then(this.receivePinnedState_.bind(this)); diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc index 82e6fe19c33..df9f8651a17 100644 --- a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc +++ b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.cc @@ -28,6 +28,7 @@ #include "chrome/browser/chromeos/tpm_firmware_update.h" #include "chrome/browser/lifetime/application_lifetime.h" #include "chrome/browser/ui/ash/ash_util.h" +#include "chrome/browser/ui/ash/tablet_mode_client.h" #include "chrome/browser/ui/webui/chromeos/login/oobe_ui.h" #include "chrome/browser/ui/webui/chromeos/login/signin_screen_handler.h" #include "chrome/common/channel_info.h" @@ -97,9 +98,14 @@ CoreOobeHandler::CoreOobeHandler(OobeUI* oobe_ui, } else { NOTIMPLEMENTED(); } + + TabletModeClient* tablet_mode_client = TabletModeClient::Get(); + tablet_mode_client->AddObserver(this); } -CoreOobeHandler::~CoreOobeHandler() {} +CoreOobeHandler::~CoreOobeHandler() { + TabletModeClient::Get()->RemoveObserver(this); +} void CoreOobeHandler::DeclareLocalizedValues( ::login::LocalizedValuesBuilder* builder) { @@ -152,6 +158,11 @@ void CoreOobeHandler::Initialize() { UpdateClientAreaSize(); } +void CoreOobeHandler::GetAdditionalParameters(base::DictionaryValue* dict) { + dict->SetKey("isInTabletMode", + base::Value(TabletModeClient::Get()->tablet_mode_enabled())); +} + void CoreOobeHandler::RegisterMessages() { AddCallback("screenStateInitialize", &CoreOobeHandler::HandleInitialized); AddCallback("skipUpdateEnrollAfterEula", @@ -497,6 +508,10 @@ void CoreOobeHandler::UpdateKeyboardState() { } } +void CoreOobeHandler::OnTabletModeToggled(bool enabled) { + CallJSOrDefer("setTabletModeState", enabled); +} + void CoreOobeHandler::UpdateClientAreaSize() { const gfx::Size size = display::Screen::GetScreen()->GetPrimaryDisplay().size(); diff --git a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h index 33ec23663aa..2579735ea1f 100644 --- a/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h +++ b/chromium/chrome/browser/ui/webui/chromeos/login/core_oobe_handler.h @@ -16,6 +16,7 @@ #include "chrome/browser/chromeos/login/demo_mode/demo_mode_detector.h" #include "chrome/browser/chromeos/login/screens/core_oobe_view.h" #include "chrome/browser/chromeos/login/version_info_updater.h" +#include "chrome/browser/ui/ash/tablet_mode_client_observer.h" #include "chrome/browser/ui/webui/chromeos/login/base_webui_handler.h" #include "ui/events/event_source.h" @@ -36,7 +37,8 @@ class OobeUI; class CoreOobeHandler : public BaseWebUIHandler, public VersionInfoUpdater::Delegate, public CoreOobeView, - public ui::EventSource { + public ui::EventSource, + public TabletModeClientObserver { public: explicit CoreOobeHandler(OobeUI* oobe_ui, JSCallsContainer* js_calls_container); @@ -47,6 +49,9 @@ class CoreOobeHandler : public BaseWebUIHandler, ::login::LocalizedValuesBuilder* builder) override; void Initialize() override; + // BaseScreenHandler implementation: + void GetAdditionalParameters(base::DictionaryValue* dict) override; + // WebUIMessageHandler implementation. void RegisterMessages() override; @@ -103,6 +108,9 @@ class CoreOobeHandler : public BaseWebUIHandler, void StopDemoModeDetection() override; void UpdateKeyboardState() override; + // TabletModeClientObserver: + void OnTabletModeToggled(bool enabled) override; + // Handlers for JS WebUI messages. void HandleEnableLargeCursor(bool enabled); void HandleEnableHighContrast(bool enabled); diff --git a/chromium/chrome/browser/ui/webui/help/version_updater.h b/chromium/chrome/browser/ui/webui/help/version_updater.h index bbf32c32a9f..2bfc0d51f94 100644 --- a/chromium/chrome/browser/ui/webui/help/version_updater.h +++ b/chromium/chrome/browser/ui/webui/help/version_updater.h @@ -48,7 +48,7 @@ class VersionUpdater { // types. #if defined(OS_CHROMEOS) typedef base::Callback<void(const std::string&)> ChannelCallback; - typedef base::Callback<void(update_engine::EndOfLifeStatus status)> + typedef base::OnceCallback<void(update_engine::EndOfLifeStatus status)> EolStatusCallback; #endif @@ -91,7 +91,7 @@ class VersionUpdater { bool is_powerwash_allowed) = 0; virtual void GetChannel(bool get_current_channel, const ChannelCallback& callback) = 0; - virtual void GetEolStatus(const EolStatusCallback& callback) = 0; + virtual void GetEolStatus(EolStatusCallback callback) = 0; // Sets a one time permission on a certain update in Update Engine. // - update_version: the Chrome OS version we want to update to. diff --git a/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.cc b/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.cc index 6f1d85c8592..9a61c4f79d7 100644 --- a/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.cc +++ b/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.cc @@ -243,19 +243,20 @@ void VersionUpdaterCros::OnGetChannel(const ChannelCallback& cb, cb.Run(current_channel); } -void VersionUpdaterCros::GetEolStatus(const EolStatusCallback& cb) { +void VersionUpdaterCros::GetEolStatus(EolStatusCallback cb) { UpdateEngineClient* update_engine_client = DBusThreadManager::Get()->GetUpdateEngineClient(); // Request the Eol Status. Bind to a weak_ptr bound method rather than passing // |cb| directly so that |cb| does not outlive |this|. - update_engine_client->GetEolStatus(base::Bind( - &VersionUpdaterCros::OnGetEolStatus, weak_ptr_factory_.GetWeakPtr(), cb)); + update_engine_client->GetEolStatus( + base::BindOnce(&VersionUpdaterCros::OnGetEolStatus, + weak_ptr_factory_.GetWeakPtr(), std::move(cb))); } -void VersionUpdaterCros::OnGetEolStatus(const EolStatusCallback& cb, +void VersionUpdaterCros::OnGetEolStatus(EolStatusCallback cb, update_engine::EndOfLifeStatus status) { - cb.Run(status); + std::move(cb).Run(status); } VersionUpdaterCros::VersionUpdaterCros(content::WebContents* web_contents) diff --git a/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.h b/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.h index 7defbfa5492..ec6ea7da17e 100644 --- a/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.h +++ b/chromium/chrome/browser/ui/webui/help/version_updater_chromeos.h @@ -33,7 +33,7 @@ class VersionUpdaterCros : public VersionUpdater, // Gets the last update status, without triggering a new check or download. void GetUpdateStatus(const StatusCallback& callback); - void GetEolStatus(const EolStatusCallback& callback) override; + void GetEolStatus(EolStatusCallback callback) override; protected: friend class VersionUpdater; @@ -58,7 +58,7 @@ class VersionUpdaterCros : public VersionUpdater, const std::string& current_channel); // Callback from UpdateEngineClient::GetEolStatus(). - void OnGetEolStatus(const EolStatusCallback& cb, + void OnGetEolStatus(EolStatusCallback cb, update_engine::EndOfLifeStatus status); // BrowserContext in which the class was instantiated. diff --git a/chromium/chrome/browser/ui/webui/print_preview/printer_capabilities.cc b/chromium/chrome/browser/ui/webui/print_preview/printer_capabilities.cc index 6205ef5ca36..ffef1099d74 100644 --- a/chromium/chrome/browser/ui/webui/print_preview/printer_capabilities.cc +++ b/chromium/chrome/browser/ui/webui/print_preview/printer_capabilities.cc @@ -309,7 +309,7 @@ void StartLocalPrint(const std::string& ticket_json, dialog_controller ? dialog_controller->GetInitiator(preview_web_contents) : nullptr; PrintViewManager* print_view_manager = - PrintViewManager::FromWebContents(initiator); + initiator ? PrintViewManager::FromWebContents(initiator) : nullptr; if (!print_view_manager) { std::move(callback).Run(base::Value("Initiator closed")); return; diff --git a/chromium/chrome/browser/ui/webui/settings/about_handler.cc b/chromium/chrome/browser/ui/webui/settings/about_handler.cc index 1920f85c03a..11da4972a25 100644 --- a/chromium/chrome/browser/ui/webui/settings/about_handler.cc +++ b/chromium/chrome/browser/ui/webui/settings/about_handler.cc @@ -335,6 +335,10 @@ AboutHandler* AboutHandler::Create(content::WebUIDataSource* html_source, html_source->AddString("aboutUserAgent", GetUserAgent()); html_source->AddString("aboutJsEngineVersion", V8_VERSION_STRING); html_source->AddString("aboutBlinkVersion", content::GetWebKitVersion()); + html_source->AddString("endOfLifeMessage", + l10n_util::GetStringUTF16(IDS_EOL_NOTIFICATION_EOL)); + html_source->AddString("endOfLifeLearnMoreURL", + base::ASCIIToUTF16(chrome::kEolNotificationURL)); #endif return new AboutHandler(); @@ -378,6 +382,10 @@ void AboutHandler::RegisterMessages() { "refreshTPMFirmwareUpdateStatus", base::Bind(&AboutHandler::HandleRefreshTPMFirmwareUpdateStatus, base::Unretained(this))); + web_ui()->RegisterMessageCallback( + "getHasEndOfLife", + base::BindRepeating(&AboutHandler::HandleGetHasEndOfLife, + base::Unretained(this))); #endif #if defined(OS_MACOSX) web_ui()->RegisterMessageCallback( @@ -602,6 +610,25 @@ void AboutHandler::RefreshTPMFirmwareUpdateStatus(bool update_available) { event->SetBoolean("updateAvailable", update_available); FireWebUIListener("tpm-firmware-update-status-changed", *event); } + +void AboutHandler::HandleGetHasEndOfLife(const base::ListValue* args) { + CHECK_EQ(1U, args->GetSize()); + std::string callback_id; + CHECK(args->GetString(0, &callback_id)); + version_updater_->GetEolStatus( + base::BindOnce(&AboutHandler::OnGetEndOfLifeStatus, + weak_factory_.GetWeakPtr(), callback_id)); +} + +void AboutHandler::OnGetEndOfLifeStatus(std::string callback_id, + update_engine::EndOfLifeStatus status) { + // Check for EndOfLifeStatus::kEol only because + // EndOfLifeStatus::kSecurityOnly state is no longer supported. + ResolveJavascriptCallback( + base::Value(callback_id), + base::Value(status == update_engine::EndOfLifeStatus::kEol)); +} + #endif // defined(OS_CHROMEOS) void AboutHandler::RequestUpdate() { diff --git a/chromium/chrome/browser/ui/webui/settings/about_handler.h b/chromium/chrome/browser/ui/webui/settings/about_handler.h index 3127e9740f8..0e47e2580e1 100644 --- a/chromium/chrome/browser/ui/webui/settings/about_handler.h +++ b/chromium/chrome/browser/ui/webui/settings/about_handler.h @@ -147,6 +147,16 @@ class AboutHandler : public settings::SettingsPageUIHandler, void OnRegulatoryLabelTextRead(std::string callback_id, const base::FilePath& label_dir_path, const std::string& text); + + // Retrieves device end of life status. + // Will asynchronously resolve the provided callback with a boolean + // indicating whether the device has reached end-of-life status (will no + // longer receive updates). + void HandleGetHasEndOfLife(const base::ListValue* args); + + // Callbacks for version_updater_->GetEolStatus calls. + void OnGetEndOfLifeStatus(std::string callback_id, + update_engine::EndOfLifeStatus status); #endif // Specialized instance of the VersionUpdater used to update the browser. diff --git a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc index 6b171c720f1..a1962a59807 100644 --- a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc +++ b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.cc @@ -376,10 +376,41 @@ void DiceTurnSyncOnHelper::SigninAndShowSyncConfirmationUI() { signin_metrics::LogSigninReason(signin_reason_); base::RecordAction(base::UserMetricsAction("Signin_Signin_Succeed")); - // Show Sync confirmation. browser_sync::ProfileSyncService* sync_service = GetProfileSyncService(); - if (sync_service) + if (sync_service) { + // Take a SyncSetupInProgressHandle, so that the UI code can use + // IsFirstSyncSetupInProgress() as a way to know if there is a signin in + // progress. + // TODO(https://crbug.com/811211): Remove this handle. sync_blocker_ = sync_service->GetSetupInProgressHandle(); + if (SyncStartupTracker::GetSyncServiceState(profile_) == + SyncStartupTracker::SYNC_STARTUP_PENDING) { + // Wait until sync is initialized so that the confirmation UI can be + // aware of startup errors. This is needed to make sure that the sync + // confirmation dialog is shown only after the sync service had a chance + // to check whether sync was disabled by admin. + // See http://crbug.com/812546 + sync_startup_tracker_.reset(new SyncStartupTracker(profile_, this)); + return; + } + } + + ShowSyncConfirmationUI(); +} + +void DiceTurnSyncOnHelper::SyncStartupCompleted() { + DCHECK(sync_startup_tracker_); + sync_startup_tracker_.reset(); + ShowSyncConfirmationUI(); +} + +void DiceTurnSyncOnHelper::SyncStartupFailed() { + DCHECK(sync_startup_tracker_); + sync_startup_tracker_.reset(); + ShowSyncConfirmationUI(); +} + +void DiceTurnSyncOnHelper::ShowSyncConfirmationUI() { scoped_login_ui_service_observer_.Add( LoginUIServiceFactory::GetForProfile(profile_)); browser_ = EnsureBrowser(browser_, profile_); diff --git a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h index d1ef87b93fe..85ef34e80f9 100644 --- a/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h +++ b/chromium/chrome/browser/ui/webui/signin/dice_turn_sync_on_helper.h @@ -10,6 +10,7 @@ #include "base/memory/weak_ptr.h" #include "base/scoped_observer.h" #include "chrome/browser/profiles/profile.h" +#include "chrome/browser/sync/sync_startup_tracker.h" #include "chrome/browser/ui/browser_list_observer.h" #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h" #include "chrome/browser/ui/webui/signin/login_ui_service.h" @@ -33,7 +34,8 @@ class SyncSetupInProgressHandle; // Handles details of signing the user in with SigninManager and turning on // sync for an account that is already present in the token service. class DiceTurnSyncOnHelper : public BrowserListObserver, - public LoginUIService::Observer { + public LoginUIService::Observer, + public SyncStartupTracker::Observer { public: // Behavior when the signin is aborted (by an error or cancelled by the user). enum class SigninAbortedMode { @@ -52,6 +54,10 @@ class DiceTurnSyncOnHelper : public BrowserListObserver, const std::string& account_id, SigninAbortedMode signin_aborted_mode); + // SyncStartupTracker::Observer: + void SyncStartupCompleted() override; + void SyncStartupFailed() override; + private: enum class ProfileMode { // Attempts to sign the user in |profile_|. Note that if the account to be @@ -121,6 +127,11 @@ class DiceTurnSyncOnHelper : public BrowserListObserver, // UI. void SigninAndShowSyncConfirmationUI(); + // Displays the Sync confirmation UI. + // Note: If sync fails to start (e.g. sync is disabled by admin), the sync + // confirmation dialog will be updated accordingly. + void ShowSyncConfirmationUI(); + // LoginUIService::Observer override. Deletes this object. void OnSyncConfirmationUIClosed( LoginUIService::SyncConfirmationUIClosedResult result) override; @@ -156,6 +167,7 @@ class DiceTurnSyncOnHelper : public BrowserListObserver, scoped_browser_list_observer_; ScopedObserver<LoginUIService, LoginUIService::Observer> scoped_login_ui_service_observer_; + std::unique_ptr<SyncStartupTracker> sync_startup_tracker_; base::WeakPtrFactory<DiceTurnSyncOnHelper> weak_pointer_factory_; DISALLOW_COPY_AND_ASSIGN(DiceTurnSyncOnHelper); diff --git a/chromium/chrome/browser/ui/webui/welcome_win10_ui.cc b/chromium/chrome/browser/ui/webui/welcome_win10_ui.cc index c1a27b163b3..ff736d62084 100644 --- a/chromium/chrome/browser/ui/webui/welcome_win10_ui.cc +++ b/chromium/chrome/browser/ui/webui/welcome_win10_ui.cc @@ -11,6 +11,7 @@ #include "chrome/browser/browser_process.h" #include "chrome/browser/profiles/profile.h" #include "chrome/browser/ui/webui/welcome_win10_handler.h" +#include "chrome/common/chrome_features.h" #include "chrome/common/pref_names.h" #include "chrome/common/url_constants.h" #include "chrome/grit/browser_resources.h" @@ -87,8 +88,15 @@ WelcomeWin10UI::WelcomeWin10UI(content::WebUI* web_ui, const GURL& url) content::WebUIDataSource* html_source = content::WebUIDataSource::Create(url.host()); + html_source->SetJsonPath("strings.js"); + AddLocalizedStrings(html_source, is_first_run); + // Controls the accelerated default browser flow experiment. + html_source->AddBoolean("accelerated_flow_enabled", + base::FeatureList::IsEnabled( + features::kWin10AcceleratedDefaultBrowserFlow)); + html_source->AddResourcePath("welcome_win10.css", IDR_WELCOME_WIN10_CSS); html_source->AddResourcePath("welcome_win10.js", IDR_WELCOME_WIN10_JS); html_source->AddResourcePath("default.webp", IDR_WELCOME_WIN10_DEFAULT_WEBP); |