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

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

Issue 10421014: Don't use BrowserList in OfflineLoadPage. Just use the system tray delegate to open internet option… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 7 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 | no next file » | 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 "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 "base/i18n/rtl.h" 10 #include "base/i18n/rtl.h"
10 #include "base/metrics/histogram.h" 11 #include "base/metrics/histogram.h"
11 #include "base/string_piece.h" 12 #include "base/string_piece.h"
12 #include "base/stringprintf.h" 13 #include "base/stringprintf.h"
13 #include "base/utf_string_conversions.h" 14 #include "base/utf_string_conversions.h"
14 #include "base/values.h" 15 #include "base/values.h"
15 #include "chrome/browser/chromeos/cros/cros_library.h" 16 #include "chrome/browser/chromeos/cros/cros_library.h"
16 #include "chrome/browser/chromeos/cros/network_library.h" 17 #include "chrome/browser/chromeos/cros/network_library.h"
17 #include "chrome/browser/extensions/extension_service.h" 18 #include "chrome/browser/extensions/extension_service.h"
18 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
19 #include "chrome/browser/renderer_preferences_util.h" 20 #include "chrome/browser/renderer_preferences_util.h"
20 #include "chrome/browser/tab_contents/tab_util.h" 21 #include "chrome/browser/tab_contents/tab_util.h"
21 #include "chrome/browser/ui/browser.h"
22 #include "chrome/browser/ui/browser_list.h"
23 #include "chrome/common/chrome_notification_types.h" 22 #include "chrome/common/chrome_notification_types.h"
24 #include "chrome/common/extensions/extension.h" 23 #include "chrome/common/extensions/extension.h"
25 #include "chrome/common/extensions/extension_icon_set.h" 24 #include "chrome/common/extensions/extension_icon_set.h"
26 #include "chrome/common/jstemplate_builder.h" 25 #include "chrome/common/jstemplate_builder.h"
27 #include "chrome/common/url_constants.h" 26 #include "chrome/common/url_constants.h"
28 #include "content/public/browser/browser_thread.h" 27 #include "content/public/browser/browser_thread.h"
29 #include "content/public/browser/interstitial_page.h" 28 #include "content/public/browser/interstitial_page.h"
30 #include "content/public/browser/notification_types.h" 29 #include "content/public/browser/notification_types.h"
31 #include "content/public/browser/web_contents.h" 30 #include "content/public/browser/web_contents.h"
32 #include "grit/browser_resources.h" 31 #include "grit/browser_resources.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 // The Jasonified response has quotes, remove them. 179 // The Jasonified response has quotes, remove them.
181 if (command.length() > 1 && command[0] == '"') { 180 if (command.length() > 1 && command[0] == '"') {
182 command = command.substr(1, command.length() - 2); 181 command = command.substr(1, command.length() - 2);
183 } 182 }
184 // TODO(oshima): record action for metrics. 183 // TODO(oshima): record action for metrics.
185 if (command == "proceed") { 184 if (command == "proceed") {
186 interstitial_page_->Proceed(); 185 interstitial_page_->Proceed();
187 } else if (command == "dontproceed") { 186 } else if (command == "dontproceed") {
188 interstitial_page_->DontProceed(); 187 interstitial_page_->DontProceed();
189 } else if (command == "open_network_settings") { 188 } else if (command == "open_network_settings") {
190 Browser* browser = BrowserList::GetLastActive(); 189 ash::Shell::GetInstance()->tray_delegate()->ShowNetworkSettings();
191 DCHECK(browser);
192 browser->ShowOptionsTab(chrome::kInternetOptionsSubPage);
193 } else if (command == "open_activate_broadband") { 190 } else if (command == "open_activate_broadband") {
194 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(); 191 ash::Shell::GetInstance()->delegate()->OpenMobileSetup();
195 } else { 192 } else {
196 LOG(WARNING) << "Unknown command:" << cmd; 193 LOG(WARNING) << "Unknown command:" << cmd;
197 } 194 }
198 } 195 }
199 196
200 void OfflineLoadPage::NotifyBlockingPageComplete(bool proceed) { 197 void OfflineLoadPage::NotifyBlockingPageComplete(bool proceed) {
201 BrowserThread::PostTask( 198 BrowserThread::PostTask(
202 BrowserThread::IO, FROM_HERE, base::Bind(callback_, proceed)); 199 BrowserThread::IO, FROM_HERE, base::Bind(callback_, proceed));
(...skipping 19 matching lines...) Expand all
222 for (size_t i = 0; i < cell_networks.size(); ++i) { 219 for (size_t i = 0; i < cell_networks.size(); ++i) {
223 chromeos::ActivationState activation_state = 220 chromeos::ActivationState activation_state =
224 cell_networks[i]->activation_state(); 221 cell_networks[i]->activation_state();
225 if (activation_state == ACTIVATION_STATE_ACTIVATED) 222 if (activation_state == ACTIVATION_STATE_ACTIVATED)
226 return false; 223 return false;
227 } 224 }
228 return true; 225 return true;
229 } 226 }
230 227
231 } // namespace chromeos 228 } // namespace chromeos
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698