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

Side by Side Diff: ash/common/test/test_system_tray_delegate.cc

Issue 2505783002: chromeos: Migrate SignOut and RequestRestartForUpdate to mojo interface (Closed)
Patch Set: Created 4 years, 1 month 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "ash/common/test/test_system_tray_delegate.h" 5 #include "ash/common/test/test_system_tray_delegate.h"
6 6
7 #include <string> 7 #include <string>
8 8
9 #include "ash/common/login_status.h" 9 #include "ash/common/login_status.h"
10 #include "ash/common/session/session_state_delegate.h" 10 #include "ash/common/session/session_state_delegate.h"
11 #include "ash/common/wm_shell.h" 11 #include "ash/common/wm_shell.h"
12 #include "base/message_loop/message_loop.h"
13 #include "base/time/time.h" 12 #include "base/time/time.h"
14 13
15 namespace ash { 14 namespace ash {
16 namespace test { 15 namespace test {
17 16
18 namespace { 17 namespace {
19 18
20 bool g_system_update_required = false; 19 bool g_system_update_required = false;
21 LoginStatus g_initial_status = LoginStatus::USER; 20 LoginStatus g_initial_status = LoginStatus::USER;
22 21
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 return session_length_limit_set_; 92 return session_length_limit_set_;
94 } 93 }
95 94
96 bool TestSystemTrayDelegate::GetSessionLengthLimit( 95 bool TestSystemTrayDelegate::GetSessionLengthLimit(
97 base::TimeDelta* session_length_limit) { 96 base::TimeDelta* session_length_limit) {
98 if (session_length_limit_set_) 97 if (session_length_limit_set_)
99 *session_length_limit = session_length_limit_; 98 *session_length_limit = session_length_limit_;
100 return session_length_limit_set_; 99 return session_length_limit_set_;
101 } 100 }
102 101
103 void TestSystemTrayDelegate::SignOut() {
104 base::MessageLoop::current()->QuitWhenIdle();
105 }
106
107 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) { 102 void TestSystemTrayDelegate::GetCurrentIME(IMEInfo* info) {
108 *info = current_ime_; 103 *info = current_ime_;
109 } 104 }
110 105
111 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) { 106 void TestSystemTrayDelegate::GetAvailableIMEList(IMEInfoList* list) {
112 *list = ime_list_; 107 *list = ime_list_;
113 } 108 }
114 109
115 //////////////////////////////////////////////////////////////////////////////// 110 ////////////////////////////////////////////////////////////////////////////////
116 111
117 ScopedInitialLoginStatus::ScopedInitialLoginStatus(LoginStatus new_status) 112 ScopedInitialLoginStatus::ScopedInitialLoginStatus(LoginStatus new_status)
118 : old_status_(g_initial_status) { 113 : old_status_(g_initial_status) {
119 g_initial_status = new_status; 114 g_initial_status = new_status;
120 } 115 }
121 116
122 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() { 117 ScopedInitialLoginStatus::~ScopedInitialLoginStatus() {
123 g_initial_status = old_status_; 118 g_initial_status = old_status_;
124 } 119 }
125 120
126 } // namespace test 121 } // namespace test
127 } // namespace ash 122 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698