OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/string_piece.h" | 9 #include "base/string_piece.h" |
10 #include "base/stringprintf.h" | 10 #include "base/stringprintf.h" |
(...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
84 base::i18n::WrapStringWithLTRFormatting(&failed_url); | 84 base::i18n::WrapStringWithLTRFormatting(&failed_url); |
85 strings.SetString("url", failed_url); | 85 strings.SetString("url", failed_url); |
86 | 86 |
87 // The offline page for app has icons and slightly different message. | 87 // The offline page for app has icons and slightly different message. |
88 Profile* profile = Profile::FromBrowserContext(tab()->browser_context()); | 88 Profile* profile = Profile::FromBrowserContext(tab()->browser_context()); |
89 DCHECK(profile); | 89 DCHECK(profile); |
90 const Extension* extension = NULL; | 90 const Extension* extension = NULL; |
91 ExtensionService* extensions_service = profile->GetExtensionService(); | 91 ExtensionService* extensions_service = profile->GetExtensionService(); |
92 // Extension service does not exist in test. | 92 // Extension service does not exist in test. |
93 if (extensions_service) | 93 if (extensions_service) |
94 extension = extensions_service->GetExtensionByWebExtent(url()); | 94 extension = extensions_service->extensions()->GetByWebExtent( |
| 95 ExtensionURLInfo(url())); |
95 | 96 |
96 if (extension) | 97 if (extension) |
97 GetAppOfflineStrings(extension, failed_url, &strings); | 98 GetAppOfflineStrings(extension, failed_url, &strings); |
98 else | 99 else |
99 GetNormalOfflineStrings(failed_url, &strings); | 100 GetNormalOfflineStrings(failed_url, &strings); |
100 | 101 |
101 base::StringPiece html( | 102 base::StringPiece html( |
102 ResourceBundle::GetSharedInstance().GetRawDataResource( | 103 ResourceBundle::GetSharedInstance().GetRawDataResource( |
103 IDR_OFFLINE_LOAD_HTML)); | 104 IDR_OFFLINE_LOAD_HTML)); |
104 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); | 105 return jstemplate_builder::GetI18nTemplateHtml(html, &strings); |
(...skipping 101 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
206 for (size_t i = 0; i < cell_networks.size(); ++i) { | 207 for (size_t i = 0; i < cell_networks.size(); ++i) { |
207 chromeos::ActivationState activation_state = | 208 chromeos::ActivationState activation_state = |
208 cell_networks[i]->activation_state(); | 209 cell_networks[i]->activation_state(); |
209 if (activation_state == ACTIVATION_STATE_ACTIVATED) | 210 if (activation_state == ACTIVATION_STATE_ACTIVATED) |
210 return false; | 211 return false; |
211 } | 212 } |
212 return true; | 213 return true; |
213 } | 214 } |
214 | 215 |
215 } // namespace chromeos | 216 } // namespace chromeos |
OLD | NEW |