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