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

Side by Side Diff: ash/shell.cc

Issue 2797743002: ash: Merge LoginStatus update code path (Closed)
Patch Set: for #2 comments Created 3 years, 8 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
« no previous file with comments | « ash/shell.h ('k') | ash/shell/content/client/shell_browser_main_parts.cc » ('j') | 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 "ash/shell.h" 5 #include "ash/shell.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 310 matching lines...) Expand 10 before | Expand all | Expand 10 after
321 views::Widget* widget) { 321 views::Widget* widget) {
322 // Use translucent-style window frames for dialogs. 322 // Use translucent-style window frames for dialogs.
323 return new CustomFrameViewAsh(widget); 323 return new CustomFrameViewAsh(widget);
324 } 324 }
325 325
326 void Shell::SetDisplayWorkAreaInsets(Window* contains, 326 void Shell::SetDisplayWorkAreaInsets(Window* contains,
327 const gfx::Insets& insets) { 327 const gfx::Insets& insets) {
328 wm_shell_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets); 328 wm_shell_->SetDisplayWorkAreaInsets(WmWindow::Get(contains), insets);
329 } 329 }
330 330
331 void Shell::OnLoginStateChanged(LoginStatus status) {
332 for (auto& observer : shell_observers_)
333 observer.OnLoginStateChanged(status);
334 }
335
336 void Shell::OnAppTerminating() { 331 void Shell::OnAppTerminating() {
337 for (auto& observer : shell_observers_) 332 for (auto& observer : shell_observers_)
338 observer.OnAppTerminating(); 333 observer.OnAppTerminating();
339 } 334 }
340 335
341 void Shell::OnLockStateChanged(bool locked) { 336 void Shell::OnLockStateChanged(bool locked) {
342 for (auto& observer : shell_observers_) 337 for (auto& observer : shell_observers_)
343 observer.OnLockStateChanged(locked); 338 observer.OnLockStateChanged(locked);
344 #ifndef NDEBUG 339 #ifndef NDEBUG
345 // Make sure that there is no system modal in Lock layer when unlocked. 340 // Make sure that there is no system modal in Lock layer when unlocked.
(...skipping 888 matching lines...) Expand 10 before | Expand all | Expand 10 after
1234 // Create the shelf when a session becomes active. It's safe to do this 1229 // Create the shelf when a session becomes active. It's safe to do this
1235 // multiple times (e.g. initial login vs. multiprofile add session). 1230 // multiple times (e.g. initial login vs. multiprofile add session).
1236 if (state == session_manager::SessionState::ACTIVE) { 1231 if (state == session_manager::SessionState::ACTIVE) {
1237 CreateShelfView(); 1232 CreateShelfView();
1238 1233
1239 if (!wm_shell_->IsRunningInMash()) { 1234 if (!wm_shell_->IsRunningInMash()) {
1240 // Recreate the keyboard after initial login and after multiprofile login. 1235 // Recreate the keyboard after initial login and after multiprofile login.
1241 CreateKeyboard(); 1236 CreateKeyboard();
1242 } 1237 }
1243 } 1238 }
1239 }
1244 1240
1245 // Only trigger an update in mash because with classic ash chrome calls 1241 void Shell::LoginStatusChanged(LoginStatus login_status) {
1246 // UpdateAfterLoginStatusChange() directly. 1242 UpdateAfterLoginStatusChange(login_status);
1247 if (wm_shell_->IsRunningInMash()) { 1243
1248 // TODO(jamescook): Should this call Shell::OnLoginStatusChanged() too? 1244 // TODO(xiyuan): Update OnLoginStateChanged -> OnLoginStatusChanged.
1249 UpdateAfterLoginStatusChange(session_controller_->GetLoginStatus()); 1245 for (auto& observer : shell_observers_)
1250 } 1246 observer.OnLoginStateChanged(login_status);
1251 } 1247 }
1252 1248
1253 void Shell::OnPrefServiceInitialized( 1249 void Shell::OnPrefServiceInitialized(
1254 std::unique_ptr<::PrefService> pref_service) { 1250 std::unique_ptr<::PrefService> pref_service) {
1255 if (!instance_) 1251 if (!instance_)
1256 return; 1252 return;
1257 DCHECK(pref_service); 1253 DCHECK(pref_service);
1258 pref_service_ = std::move(pref_service); 1254 pref_service_ = std::move(pref_service);
1259 } 1255 }
1260 1256
1261 } // namespace ash 1257 } // namespace ash
OLDNEW
« no previous file with comments | « ash/shell.h ('k') | ash/shell/content/client/shell_browser_main_parts.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698