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

Side by Side Diff: chrome/browser/chromeos/display/display_configuration_observer.cc

Issue 2437393002: Remove ash::ShellDelegate::IsFirstRunAfterBoot method (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
« no previous file with comments | « ash/test/test_shell_delegate.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 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 "chrome/browser/chromeos/display/display_configuration_observer.h" 5 #include "chrome/browser/chromeos/display/display_configuration_observer.h"
6 6
7 #include "ash/common/shell_delegate.h"
8 #include "ash/common/wm_shell.h"
9 #include "ash/display/window_tree_host_manager.h" 7 #include "ash/display/window_tree_host_manager.h"
10 #include "ash/shell.h" 8 #include "ash/shell.h"
9 #include "base/command_line.h"
11 #include "chrome/browser/chromeos/display/display_preferences.h" 10 #include "chrome/browser/chromeos/display/display_preferences.h"
11 #include "chromeos/chromeos_switches.h"
12 12
13 namespace chromeos { 13 namespace chromeos {
14 14
15 DisplayConfigurationObserver::DisplayConfigurationObserver() { 15 DisplayConfigurationObserver::DisplayConfigurationObserver() {
16 ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this); 16 ash::Shell::GetInstance()->window_tree_host_manager()->AddObserver(this);
17 } 17 }
18 18
19 DisplayConfigurationObserver::~DisplayConfigurationObserver() { 19 DisplayConfigurationObserver::~DisplayConfigurationObserver() {
20 ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this); 20 ash::Shell::GetInstance()->window_tree_host_manager()->RemoveObserver(this);
21 } 21 }
22 22
23 void DisplayConfigurationObserver::OnDisplaysInitialized() { 23 void DisplayConfigurationObserver::OnDisplaysInitialized() {
24 // Update the display pref with the initial power state. 24 // Update the display pref with the initial power state.
25 if (ash::WmShell::Get()->delegate()->IsFirstRunAfterBoot()) 25 base::CommandLine* command_line = base::CommandLine::ForCurrentProcess();
26 if (command_line->HasSwitch(chromeos::switches::kFirstExecAfterBoot))
26 StoreDisplayPrefs(); 27 StoreDisplayPrefs();
27 } 28 }
28 29
29 void DisplayConfigurationObserver::OnDisplayConfigurationChanged() { 30 void DisplayConfigurationObserver::OnDisplayConfigurationChanged() {
30 StoreDisplayPrefs(); 31 StoreDisplayPrefs();
31 } 32 }
32 33
33 } // namespace chromeos 34 } // namespace chromeos
OLDNEW
« no previous file with comments | « ash/test/test_shell_delegate.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698