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 "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 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // Use a local error page. | 72 // Use a local error page. |
73 int resource_id; | 73 int resource_id; |
74 base::DictionaryValue error_strings; | 74 base::DictionaryValue error_strings; |
75 | 75 |
76 // The offline page for app has icons and slightly different message. | 76 // The offline page for app has icons and slightly different message. |
77 Profile* profile = Profile::FromBrowserContext( | 77 Profile* profile = Profile::FromBrowserContext( |
78 web_contents_->GetBrowserContext()); | 78 web_contents_->GetBrowserContext()); |
79 DCHECK(profile); | 79 DCHECK(profile); |
80 const extensions::Extension* extension = extensions::ExtensionRegistry::Get( | 80 const extensions::Extension* extension = extensions::ExtensionRegistry::Get( |
81 profile)->enabled_extensions().GetHostedAppByURL(url_); | 81 profile)->enabled_extensions().GetHostedAppByURL(url_); |
| 82 const std::string& locale = g_browser_process->GetApplicationLocale(); |
82 if (extension && !extension->from_bookmark()) { | 83 if (extension && !extension->from_bookmark()) { |
83 LocalizedError::GetAppErrorStrings(url_, extension, &error_strings); | 84 LocalizedError::GetAppErrorStrings(url_, extension, locale, &error_strings); |
84 resource_id = IDR_OFFLINE_APP_LOAD_HTML; | 85 resource_id = IDR_OFFLINE_APP_LOAD_HTML; |
85 } else { | 86 } else { |
86 const std::string locale = g_browser_process->GetApplicationLocale(); | |
87 const std::string accept_languages = | 87 const std::string accept_languages = |
88 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); | 88 profile->GetPrefs()->GetString(prefs::kAcceptLanguages); |
89 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED, | 89 LocalizedError::GetStrings(net::ERR_INTERNET_DISCONNECTED, |
90 net::kErrorDomain, url_, false, false, locale, | 90 net::kErrorDomain, url_, false, false, locale, |
91 accept_languages, | 91 accept_languages, |
92 scoped_ptr<error_page::ErrorPageParams>(), | 92 scoped_ptr<error_page::ErrorPageParams>(), |
93 &error_strings); | 93 &error_strings); |
94 resource_id = IDR_OFFLINE_NET_LOAD_HTML; | 94 resource_id = IDR_OFFLINE_NET_LOAD_HTML; |
95 } | 95 } |
96 | 96 |
(...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; | 159 const bool online = type != net::NetworkChangeNotifier::CONNECTION_NONE; |
160 DVLOG(1) << "ConnectionTypeObserver notification received: state=" | 160 DVLOG(1) << "ConnectionTypeObserver notification received: state=" |
161 << (online ? "online" : "offline"); | 161 << (online ? "online" : "offline"); |
162 if (online) { | 162 if (online) { |
163 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); | 163 net::NetworkChangeNotifier::RemoveConnectionTypeObserver(this); |
164 interstitial_page_->Proceed(); | 164 interstitial_page_->Proceed(); |
165 } | 165 } |
166 } | 166 } |
167 | 167 |
168 } // namespace chromeos | 168 } // namespace chromeos |
OLD | NEW |