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

Side by Side Diff: chrome/browser/ui/ash/network_connect_delegate_chromeos.cc

Issue 2041233005: Moves ash::user::LoginStatus to ash/common (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix test Created 4 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
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/ui/ash/network_connect_delegate_chromeos.h" 5 #include "chrome/browser/ui/ash/network_connect_delegate_chromeos.h"
6 6
7 #include "ash/common/session/session_state_delegate.h" 7 #include "ash/common/session/session_state_delegate.h"
8 #include "ash/common/shell_window_ids.h" 8 #include "ash/common/shell_window_ids.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "ash/system/tray/system_tray_delegate.h" 10 #include "ash/system/tray/system_tray_delegate.h"
11 #include "ash/system/user/login_status.h" 11 #include "ash/system/user/login_status.h"
12 #include "chrome/browser/chromeos/enrollment_dialog_view.h" 12 #include "chrome/browser/chromeos/enrollment_dialog_view.h"
13 #include "chrome/browser/chromeos/options/network_config_view.h" 13 #include "chrome/browser/chromeos/options/network_config_view.h"
14 #include "chrome/browser/chromeos/sim_dialog_delegate.h" 14 #include "chrome/browser/chromeos/sim_dialog_delegate.h"
15 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h" 15 #include "chrome/browser/ui/webui/chromeos/mobile_setup_dialog.h"
16 16
17 namespace { 17 namespace {
18 18
19 bool IsUIAvailable() { 19 bool IsUIAvailable() {
20 return ash::Shell::GetInstance() && 20 return ash::Shell::GetInstance() &&
21 !ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked(); 21 !ash::Shell::GetInstance()->session_state_delegate()->IsScreenLocked();
22 } 22 }
23 23
24 gfx::NativeWindow GetNativeWindow() { 24 gfx::NativeWindow GetNativeWindow() {
25 bool session_started = ash::Shell::GetInstance() 25 bool session_started = ash::Shell::GetInstance()
26 ->session_state_delegate() 26 ->session_state_delegate()
27 ->IsActiveUserSessionStarted(); 27 ->IsActiveUserSessionStarted();
28 ash::user::LoginStatus login_status = 28 ash::LoginStatus login_status =
29 ash::Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus(); 29 ash::Shell::GetInstance()->system_tray_delegate()->GetUserLoginStatus();
30 bool isUserAddingRunning = ash::Shell::GetInstance() 30 bool isUserAddingRunning = ash::Shell::GetInstance()
31 ->session_state_delegate() 31 ->session_state_delegate()
32 ->IsInSecondaryLoginScreen(); 32 ->IsInSecondaryLoginScreen();
33 33
34 int container_id = 34 int container_id =
35 (!session_started || login_status == ash::user::LOGGED_IN_NONE || 35 (!session_started || login_status == ash::LoginStatus::NOT_LOGGED_IN ||
36 login_status == ash::user::LOGGED_IN_LOCKED || isUserAddingRunning) 36 login_status == ash::LoginStatus::LOCKED || isUserAddingRunning)
37 ? ash::kShellWindowId_LockSystemModalContainer 37 ? ash::kShellWindowId_LockSystemModalContainer
38 : ash::kShellWindowId_SystemModalContainer; 38 : ash::kShellWindowId_SystemModalContainer;
39 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(), 39 return ash::Shell::GetContainer(ash::Shell::GetPrimaryRootWindow(),
40 container_id); 40 container_id);
41 } 41 }
42 42
43 } // namespace 43 } // namespace
44 44
45 namespace chromeos { 45 namespace chromeos {
46 46
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
80 } 80 }
81 81
82 void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog( 82 void NetworkConnectDelegateChromeOS::ShowMobileSetupDialog(
83 const std::string& service_path) { 83 const std::string& service_path) {
84 if (!IsUIAvailable()) 84 if (!IsUIAvailable())
85 return; 85 return;
86 MobileSetupDialog::Show(service_path); 86 MobileSetupDialog::Show(service_path);
87 } 87 }
88 88
89 } // namespace chromeos 89 } // namespace chromeos
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698