| 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 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 | 107 |
| 108 // The offline page for app has icons and slightly different message. | 108 // The offline page for app has icons and slightly different message. |
| 109 Profile* profile = Profile::FromBrowserContext( | 109 Profile* profile = Profile::FromBrowserContext( |
| 110 web_contents_->GetBrowserContext()); | 110 web_contents_->GetBrowserContext()); |
| 111 DCHECK(profile); | 111 DCHECK(profile); |
| 112 const extensions::Extension* extension = NULL; | 112 const extensions::Extension* extension = NULL; |
| 113 ExtensionService* extensions_service = | 113 ExtensionService* extensions_service = |
| 114 extensions::ExtensionSystem::Get(profile)->extension_service(); | 114 extensions::ExtensionSystem::Get(profile)->extension_service(); |
| 115 // Extension service does not exist in test. | 115 // Extension service does not exist in test. |
| 116 if (extensions_service) | 116 if (extensions_service) |
| 117 extension = extensions_service->extensions()->GetHostedAppByURL( | 117 extension = extensions_service->extensions()->GetHostedAppByURL(url_); |
| 118 ExtensionURLInfo(url_)); | |
| 119 | 118 |
| 120 if (extension) | 119 if (extension) |
| 121 GetAppOfflineStrings(extension, &strings); | 120 GetAppOfflineStrings(extension, &strings); |
| 122 else | 121 else |
| 123 GetNormalOfflineStrings(&strings); | 122 GetNormalOfflineStrings(&strings); |
| 124 | 123 |
| 125 base::StringPiece html( | 124 base::StringPiece html( |
| 126 ResourceBundle::GetSharedInstance().GetRawDataResource( | 125 ResourceBundle::GetSharedInstance().GetRawDataResource( |
| 127 IDR_OFFLINE_LOAD_HTML)); | 126 IDR_OFFLINE_LOAD_HTML)); |
| 128 return webui::GetI18nTemplateHtml(html, &strings); | 127 return webui::GetI18nTemplateHtml(html, &strings); |
| (...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 204 for (size_t i = 0; i < cell_networks.size(); ++i) { | 203 for (size_t i = 0; i < cell_networks.size(); ++i) { |
| 205 chromeos::ActivationState activation_state = | 204 chromeos::ActivationState activation_state = |
| 206 cell_networks[i]->activation_state(); | 205 cell_networks[i]->activation_state(); |
| 207 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 206 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
| 208 return false; | 207 return false; |
| 209 } | 208 } |
| 210 return true; | 209 return true; |
| 211 } | 210 } |
| 212 | 211 |
| 213 } // namespace chromeos | 212 } // namespace chromeos |
| OLD | NEW |