| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/offline/offline_load_page.h" | 5 #include "chrome/browser/chromeos/offline/offline_load_page.h" |
| 6 | 6 |
| 7 #include "apps/launcher.h" | 7 #include "apps/launcher.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/system/tray/system_tray_delegate.h" | 10 #include "ash/system/tray/system_tray_delegate.h" |
| 11 #include "base/i18n/rtl.h" | 11 #include "base/i18n/rtl.h" |
| 12 #include "base/metrics/histogram.h" | 12 #include "base/metrics/histogram.h" |
| 13 #include "base/prefs/pref_service.h" | 13 #include "base/prefs/pref_service.h" |
| 14 #include "base/strings/string_piece.h" | 14 #include "base/strings/string_piece.h" |
| 15 #include "base/strings/stringprintf.h" | 15 #include "base/strings/stringprintf.h" |
| 16 #include "base/strings/utf_string_conversions.h" | 16 #include "base/strings/utf_string_conversions.h" |
| 17 #include "base/values.h" | 17 #include "base/values.h" |
| 18 #include "chrome/browser/browser_process.h" | 18 #include "chrome/browser/browser_process.h" |
| 19 #include "chrome/browser/chrome_notification_types.h" | 19 #include "chrome/browser/chrome_notification_types.h" |
| 20 #include "chrome/browser/profiles/profile.h" | 20 #include "chrome/browser/profiles/profile.h" |
| 21 #include "chrome/browser/renderer_preferences_util.h" | 21 #include "chrome/browser/renderer_preferences_util.h" |
| 22 #include "chrome/browser/tab_contents/tab_util.h" | 22 #include "chrome/browser/tab_contents/tab_util.h" |
| 23 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 23 #include "chrome/common/extensions/extension_constants.h" | 24 #include "chrome/common/extensions/extension_constants.h" |
| 24 #include "chrome/common/localized_error.h" | 25 #include "chrome/common/localized_error.h" |
| 25 #include "chrome/common/pref_names.h" | 26 #include "chrome/common/pref_names.h" |
| 26 #include "chrome/common/url_constants.h" | 27 #include "chrome/common/url_constants.h" |
| 27 #include "chrome/grit/browser_resources.h" | 28 #include "chrome/grit/browser_resources.h" |
| 28 #include "content/public/browser/browser_thread.h" | 29 #include "content/public/browser/browser_thread.h" |
| 29 #include "content/public/browser/interstitial_page.h" | 30 #include "content/public/browser/interstitial_page.h" |
| 30 #include "content/public/browser/notification_types.h" | 31 #include "content/public/browser/notification_types.h" |
| 31 #include "content/public/browser/web_contents.h" | 32 #include "content/public/browser/web_contents.h" |
| 33 #include "content/public/common/renderer_preferences.h" |
| 32 #include "extensions/browser/extension_registry.h" | 34 #include "extensions/browser/extension_registry.h" |
| 33 #include "extensions/browser/extension_system.h" | 35 #include "extensions/browser/extension_system.h" |
| 34 #include "extensions/common/extension.h" | 36 #include "extensions/common/extension.h" |
| 35 #include "extensions/common/extension_icon_set.h" | 37 #include "extensions/common/extension_icon_set.h" |
| 36 #include "extensions/common/manifest_handlers/icons_handler.h" | 38 #include "extensions/common/manifest_handlers/icons_handler.h" |
| 37 #include "net/base/escape.h" | 39 #include "net/base/escape.h" |
| 38 #include "net/base/net_errors.h" | 40 #include "net/base/net_errors.h" |
| 39 #include "ui/base/resource/resource_bundle.h" | 41 #include "ui/base/resource/resource_bundle.h" |
| 40 #include "ui/base/webui/jstemplate_builder.h" | 42 #include "ui/base/webui/jstemplate_builder.h" |
| 41 #include "ui/base/webui/web_ui_util.h" | 43 #include "ui/base/webui/web_ui_util.h" |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 96 ResourceBundle::GetSharedInstance().GetRawDataResource( | 98 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 97 resource_id)); | 99 resource_id)); |
| 98 // "t" is the id of the templates root node. | 100 // "t" is the id of the templates root node. |
| 99 return webui::GetTemplatesHtml(template_html, &error_strings, "t"); | 101 return webui::GetTemplatesHtml(template_html, &error_strings, "t"); |
| 100 } | 102 } |
| 101 | 103 |
| 102 void OfflineLoadPage::OverrideRendererPrefs( | 104 void OfflineLoadPage::OverrideRendererPrefs( |
| 103 content::RendererPreferences* prefs) { | 105 content::RendererPreferences* prefs) { |
| 104 Profile* profile = Profile::FromBrowserContext( | 106 Profile* profile = Profile::FromBrowserContext( |
| 105 web_contents_->GetBrowserContext()); | 107 web_contents_->GetBrowserContext()); |
| 106 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); | 108 renderer_preferences_util::UpdateFromSystemSettings( |
| 109 prefs, profile, web_contents_); |
| 107 } | 110 } |
| 108 | 111 |
| 109 void OfflineLoadPage::OnProceed() { | 112 void OfflineLoadPage::OnProceed() { |
| 110 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 113 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| 111 proceeded_ = true; | 114 proceeded_ = true; |
| 112 NotifyBlockingPageComplete(true); | 115 NotifyBlockingPageComplete(true); |
| 113 } | 116 } |
| 114 | 117 |
| 115 void OfflineLoadPage::OnDontProceed() { | 118 void OfflineLoadPage::OnDontProceed() { |
| 116 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); | 119 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 155 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; | 158 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; |
| 156 DVLOG(1) << "ConnectionTypeObserver notification received: state=" | 159 DVLOG(1) << "ConnectionTypeObserver notification received: state=" |
| 157 << (online ? "online" : "offline"); | 160 << (online ? "online" : "offline"); |
| 158 if (online) { | 161 if (online) { |
| 159 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 162 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
| 160 interstitial_page_->Proceed(); | 163 interstitial_page_->Proceed(); |
| 161 } | 164 } |
| 162 } | 165 } |
| 163 | 166 |
| 164 } // namespace chromeos | 167 } // namespace chromeos |
| OLD | NEW |