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

Side by Side Diff: chrome/browser/chromeos/status/network_menu.cc

Issue 10456045: Refactored mobile activation engine outside of WebUI handler in order to expose its state to other … (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 6 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
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/status/network_menu.h" 5 #include "chrome/browser/chromeos/status/network_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/shell_delegate.h" 10 #include "ash/shell_delegate.h"
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
88 } 88 }
89 } 89 }
90 } 90 }
91 91
92 // Activate a cellular network. 92 // Activate a cellular network.
93 void ActivateCellular(const chromeos::CellularNetwork* cellular) { 93 void ActivateCellular(const chromeos::CellularNetwork* cellular) {
94 DCHECK(cellular); 94 DCHECK(cellular);
95 if (!chromeos::UserManager::Get()->IsSessionStarted()) 95 if (!chromeos::UserManager::Get()->IsSessionStarted())
96 return; 96 return;
97 97
98 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(); 98 ash::Shell::GetInstance()->delegate()->OpenMobileSetup(
99 cellular->service_path());
99 } 100 }
100 101
101 // Decides whether a network should be highlighted in the UI. 102 // Decides whether a network should be highlighted in the UI.
102 bool ShouldHighlightNetwork(const chromeos::Network* network) { 103 bool ShouldHighlightNetwork(const chromeos::Network* network) {
103 chromeos::NetworkLibrary* cros = 104 chromeos::NetworkLibrary* cros =
104 chromeos::CrosLibrary::Get()->GetNetworkLibrary(); 105 chromeos::CrosLibrary::Get()->GetNetworkLibrary();
105 return cros->connected_network() ? network == cros->connected_network() : 106 return cros->connected_network() ? network == cros->connected_network() :
106 network == cros->connecting_network(); 107 network == cros->connecting_network();
107 } 108 }
108 109
(...skipping 1049 matching lines...) Expand 10 before | Expand all | Expand 10 after
1158 return ::ShouldHighlightNetwork(network); 1159 return ::ShouldHighlightNetwork(network);
1159 } 1160 }
1160 1161
1161 Browser* NetworkMenu::GetAppropriateBrowser() const { 1162 Browser* NetworkMenu::GetAppropriateBrowser() const {
1162 DCHECK(chromeos::UserManager::Get()->IsSessionStarted()); 1163 DCHECK(chromeos::UserManager::Get()->IsSessionStarted());
1163 return browser::FindOrCreateTabbedBrowser( 1164 return browser::FindOrCreateTabbedBrowser(
1164 ProfileManager::GetDefaultProfileOrOffTheRecord()); 1165 ProfileManager::GetDefaultProfileOrOffTheRecord());
1165 } 1166 }
1166 1167
1167 } // namespace chromeos 1168 } // namespace chromeos
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/offline/offline_load_page.cc ('k') | chrome/browser/resources/options2/chromeos/internet_detail.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698