Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4)

Side by Side Diff: chrome/browser/chromeos/offline/offline_load_page.cc

Issue 8827013: Move/replace/rename URL-based extension getters from ExtensionService to/in ExtensionSet. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: id Created 9 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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
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()->GetHostedAppByURL(
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
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
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/login/help_app_launcher.cc ('k') | chrome/browser/extensions/crx_installer.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698