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