Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Side by Side Diff: chrome/browser/chromeos/login/signin/merge_session_load_page.cc

Issue 541103002: Introduce ChromeZoomLevelPref, make zoom level prefs independent of profile prefs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Address comments (use WeakPtr in callback). Created 6 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h" 5 #include "chrome/browser/chromeos/login/signin/merge_session_load_page.h"
6 6
7 #include "ash/shell.h" 7 #include "ash/shell.h"
8 #include "ash/shell_delegate.h" 8 #include "ash/shell_delegate.h"
9 #include "ash/system/tray/system_tray_delegate.h" 9 #include "ash/system/tray/system_tray_delegate.h"
10 #include "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
11 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
12 #include "base/strings/string_piece.h" 12 #include "base/strings/string_piece.h"
13 #include "base/strings/stringprintf.h" 13 #include "base/strings/stringprintf.h"
14 #include "base/strings/utf_string_conversions.h" 14 #include "base/strings/utf_string_conversions.h"
15 #include "base/values.h" 15 #include "base/values.h"
16 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
17 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h" 17 #include "chrome/browser/chromeos/login/signin/oauth2_login_manager_factory.h"
18 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
19 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
20 #include "chrome/browser/renderer_preferences_util.h" 20 #include "chrome/browser/renderer_preferences_util.h"
21 #include "chrome/browser/tab_contents/tab_util.h" 21 #include "chrome/browser/tab_contents/tab_util.h"
22 #include "chrome/browser/ui/zoom/zoom_controller.h"
22 #include "chrome/common/extensions/extension_constants.h" 23 #include "chrome/common/extensions/extension_constants.h"
23 #include "chrome/common/url_constants.h" 24 #include "chrome/common/url_constants.h"
24 #include "chrome/grit/browser_resources.h" 25 #include "chrome/grit/browser_resources.h"
25 #include "chrome/grit/generated_resources.h" 26 #include "chrome/grit/generated_resources.h"
26 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
27 #include "content/public/browser/interstitial_page.h" 28 #include "content/public/browser/interstitial_page.h"
28 #include "content/public/browser/notification_types.h" 29 #include "content/public/browser/notification_types.h"
29 #include "content/public/browser/web_contents.h" 30 #include "content/public/browser/web_contents.h"
30 #include "extensions/browser/extension_system.h" 31 #include "extensions/browser/extension_system.h"
31 #include "extensions/common/extension.h" 32 #include "extensions/common/extension.h"
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 base::StringPiece html( 94 base::StringPiece html(
94 ResourceBundle::GetSharedInstance().GetRawDataResource( 95 ResourceBundle::GetSharedInstance().GetRawDataResource(
95 IDR_MERGE_SESSION_LOAD_HTML)); 96 IDR_MERGE_SESSION_LOAD_HTML));
96 return webui::GetI18nTemplateHtml(html, &strings); 97 return webui::GetI18nTemplateHtml(html, &strings);
97 } 98 }
98 99
99 void MergeSessionLoadPage::OverrideRendererPrefs( 100 void MergeSessionLoadPage::OverrideRendererPrefs(
100 content::RendererPreferences* prefs) { 101 content::RendererPreferences* prefs) {
101 Profile* profile = Profile::FromBrowserContext( 102 Profile* profile = Profile::FromBrowserContext(
102 web_contents_->GetBrowserContext()); 103 web_contents_->GetBrowserContext());
104 prefs->default_zoom_level =
105 ZoomController::FromWebContents(web_contents_)->GetDefaultZoomLevel();
103 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); 106 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile);
104 } 107 }
105 108
106 void MergeSessionLoadPage::OnProceed() { 109 void MergeSessionLoadPage::OnProceed() {
107 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
108 proceeded_ = true; 111 proceeded_ = true;
109 NotifyBlockingPageComplete(); 112 NotifyBlockingPageComplete();
110 } 113 }
111 114
112 void MergeSessionLoadPage::OnDontProceed() { 115 void MergeSessionLoadPage::OnDontProceed() {
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 " NOT " : "") 166 " NOT " : "")
164 << " be blocking now, " 167 << " be blocking now, "
165 << state; 168 << state;
166 if (!manager->ShouldBlockTabLoading()) { 169 if (!manager->ShouldBlockTabLoading()) {
167 manager->RemoveObserver(this); 170 manager->RemoveObserver(this);
168 interstitial_page_->Proceed(); 171 interstitial_page_->Proceed();
169 } 172 }
170 } 173 }
171 174
172 } // namespace chromeos 175 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698