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

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

Issue 138513002: Plumb network stack information about existence of cached copy (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync'd to r248769. Created 6 years, 10 months 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
« no previous file with comments | « no previous file | chrome/browser/errorpage_browsertest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "apps/launcher.h" 7 #include "apps/launcher.h"
8 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "ash/shell_delegate.h" 9 #include "ash/shell_delegate.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 extension = extensions_service->extensions()->GetHostedAppByURL(url_); 89 extension = extensions_service->extensions()->GetHostedAppByURL(url_);
90 90
91 if (extension && !extension->from_bookmark()) { 91 if (extension && !extension->from_bookmark()) {
92 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings); 92 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings);
93 resource_id = IDR_OFFLINE_APP_LOAD_HTML; 93 resource_id = IDR_OFFLINE_APP_LOAD_HTML;
94 } else { 94 } else {
95 const std::string locale = g_browser_process->GetApplicationLocale(); 95 const std::string locale = g_browser_process->GetApplicationLocale();
96 const std::string accept_languages = 96 const std::string accept_languages =
97 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); 97 profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
98 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED, 98 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED,
99 net::kErrorDomain, url_, false, locale, 99 net::kErrorDomain, url_, false, false, locale,
100 accept_languages, &error_strings); 100 accept_languages, &error_strings);
101 resource_id = IDR_OFFLINE_NET_LOAD_HTML; 101 resource_id = IDR_OFFLINE_NET_LOAD_HTML;
102 } 102 }
103 103
104 const base::StringPiece template_html( 104 const base::StringPiece template_html(
105 ResourceBundle::GetSharedInstance().GetRawDataResource( 105 ResourceBundle::GetSharedInstance().GetRawDataResource(
106 resource_id)); 106 resource_id));
107 // "t" is the id of the templates root node. 107 // "t" is the id of the templates root node.
108 return webui::GetTemplatesHtml(template_html, &error_strings, "t"); 108 return webui::GetTemplatesHtml(template_html, &error_strings, "t");
109 } 109 }
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
162 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; 162 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE;
163 DVLOG(1) << "ConnectionTypeObserver notification received: state=" 163 DVLOG(1) << "ConnectionTypeObserver notification received: state="
164 << (online ? "online" : "offline"); 164 << (online ? "online" : "offline");
165 if (online) { 165 if (online) {
166 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 166 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
167 interstitial_page_->Proceed(); 167 interstitial_page_->Proceed();
168 } 168 }
169 } 169 }
170 170
171 } // namespace chromeos 171 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/errorpage_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698