| 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 "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" |
| (...skipping 14 matching lines...) Expand all Loading... |
| 25 #include "chrome/common/jstemplate_builder.h" | 25 #include "chrome/common/jstemplate_builder.h" |
| 26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 27 #include "content/public/browser/browser_thread.h" | 27 #include "content/public/browser/browser_thread.h" |
| 28 #include "content/public/browser/interstitial_page.h" | 28 #include "content/public/browser/interstitial_page.h" |
| 29 #include "content/public/browser/notification_types.h" | 29 #include "content/public/browser/notification_types.h" |
| 30 #include "content/public/browser/web_contents.h" | 30 #include "content/public/browser/web_contents.h" |
| 31 #include "grit/browser_resources.h" | 31 #include "grit/browser_resources.h" |
| 32 #include "grit/generated_resources.h" | 32 #include "grit/generated_resources.h" |
| 33 #include "net/base/escape.h" | 33 #include "net/base/escape.h" |
| 34 #include "ui/base/l10n/l10n_util.h" | 34 #include "ui/base/l10n/l10n_util.h" |
| 35 #include "ui/base/layout.h" |
| 35 #include "ui/base/resource/resource_bundle.h" | 36 #include "ui/base/resource/resource_bundle.h" |
| 36 | 37 |
| 37 using content::BrowserThread; | 38 using content::BrowserThread; |
| 38 using content::InterstitialPage; | 39 using content::InterstitialPage; |
| 39 using content::WebContents; | 40 using content::WebContents; |
| 40 | 41 |
| 41 namespace { | 42 namespace { |
| 42 | 43 |
| 43 // Maximum time to show a blank page. | 44 // Maximum time to show a blank page. |
| 44 const int kMaxBlankPeriod = 3000; | 45 const int kMaxBlankPeriod = 3000; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 104 extension = extensions_service->extensions()->GetHostedAppByURL( | 105 extension = extensions_service->extensions()->GetHostedAppByURL( |
| 105 ExtensionURLInfo(url_)); | 106 ExtensionURLInfo(url_)); |
| 106 | 107 |
| 107 if (extension) | 108 if (extension) |
| 108 GetAppOfflineStrings(extension, failed_url, &strings); | 109 GetAppOfflineStrings(extension, failed_url, &strings); |
| 109 else | 110 else |
| 110 GetNormalOfflineStrings(failed_url, &strings); | 111 GetNormalOfflineStrings(failed_url, &strings); |
| 111 | 112 |
| 112 base::StringPiece html( | 113 base::StringPiece html( |
| 113 ResourceBundle::GetSharedInstance().GetRawDataResource( | 114 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 114 IDR_OFFLINE_LOAD_HTML)); | 115 IDR_OFFLINE_LOAD_HTML, ui::SCALE_FACTOR_NONE)); |
| 115 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); | 116 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); |
| 116 } | 117 } |
| 117 | 118 |
| 118 void OfflineLoadPage::OverrideRendererPrefs( | 119 void OfflineLoadPage::OverrideRendererPrefs( |
| 119 content::RendererPreferences* prefs) { | 120 content::RendererPreferences* prefs) { |
| 120 Profile* profile = Profile::FromBrowserContext( | 121 Profile* profile = Profile::FromBrowserContext( |
| 121 web_contents_->GetBrowserContext()); | 122 web_contents_->GetBrowserContext()); |
| 122 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); | 123 renderer_preferences_util::UpdateFromSystemSettings(prefs, profile); |
| 123 } | 124 } |
| 124 | 125 |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 219 for (size_t i = 0; i < cell_networks.size(); ++i) { | 220 for (size_t i = 0; i < cell_networks.size(); ++i) { |
| 220 chromeos::ActivationState activation_state = | 221 chromeos::ActivationState activation_state = |
| 221 cell_networks[i]->activation_state(); | 222 cell_networks[i]->activation_state(); |
| 222 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 223 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
| 223 return false; | 224 return false; |
| 224 } | 225 } |
| 225 return true; | 226 return true; |
| 226 } | 227 } |
| 227 | 228 |
| 228 } // namespace chromeos | 229 } // namespace chromeos |
| OLD | NEW |