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

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: Created 6 years, 11 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') | net/http/http_cache.h » ('J')
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 "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 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 extension = extensions_service->extensions()->GetHostedAppByURL(url_); 88 extension = extensions_service->extensions()->GetHostedAppByURL(url_);
89 89
90 if (extension && !extension->from_bookmark()) { 90 if (extension && !extension->from_bookmark()) {
91 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings); 91 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings);
92 resource_id = IDR_OFFLINE_APP_LOAD_HTML; 92 resource_id = IDR_OFFLINE_APP_LOAD_HTML;
93 } else { 93 } else {
94 const std::string locale = g_browser_process->GetApplicationLocale(); 94 const std::string locale = g_browser_process->GetApplicationLocale();
95 const std::string accept_languages = 95 const std::string accept_languages =
96 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); 96 profile->GetPrefs()->GetString(prefs::kAcceptLanguages);
97 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED, 97 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED,
98 net::kErrorDomain, url_, false, locale, 98 net::kErrorDomain, url_, false, false, locale,
99 accept_languages, &error_strings); 99 accept_languages, &error_strings);
100 resource_id = IDR_OFFLINE_NET_LOAD_HTML; 100 resource_id = IDR_OFFLINE_NET_LOAD_HTML;
101 } 101 }
102 102
103 const base::StringPiece template_html( 103 const base::StringPiece template_html(
104 ResourceBundle::GetSharedInstance().GetRawDataResource( 104 ResourceBundle::GetSharedInstance().GetRawDataResource(
105 resource_id)); 105 resource_id));
106 // "t" is the id of the templates root node. 106 // "t" is the id of the templates root node.
107 return webui::GetTemplatesHtml(template_html, &error_strings, "t"); 107 return webui::GetTemplatesHtml(template_html, &error_strings, "t");
108 } 108 }
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after
153 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; 153 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE;
154 DVLOG(1) << "ConnectionTypeObserver notification received: state=" 154 DVLOG(1) << "ConnectionTypeObserver notification received: state="
155 << (online ? "online" : "offline"); 155 << (online ? "online" : "offline");
156 if (online) { 156 if (online) {
157 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); 157 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this);
158 interstitial_page_->Proceed(); 158 interstitial_page_->Proceed();
159 } 159 }
160 } 160 }
161 161
162 } // namespace chromeos 162 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/errorpage_browsertest.cc » ('j') | net/http/http_cache.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698