| OLD | NEW |
| 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/ui/ash/chrome_shell_delegate.h" | 5 #include "chrome/browser/ui/ash/chrome_shell_delegate.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <limits> | 9 #include <limits> |
| 10 | 10 |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "ash/wm/window_util.h" | 22 #include "ash/wm/window_util.h" |
| 23 #include "base/command_line.h" | 23 #include "base/command_line.h" |
| 24 #include "base/macros.h" | 24 #include "base/macros.h" |
| 25 #include "base/memory/ptr_util.h" | 25 #include "base/memory/ptr_util.h" |
| 26 #include "build/build_config.h" | 26 #include "build/build_config.h" |
| 27 #include "chrome/browser/app_mode/app_mode_utils.h" | 27 #include "chrome/browser/app_mode/app_mode_utils.h" |
| 28 #include "chrome/browser/chrome_notification_types.h" | 28 #include "chrome/browser/chrome_notification_types.h" |
| 29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" | 29 #include "chrome/browser/chromeos/accessibility/accessibility_manager.h" |
| 30 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" | 30 #include "chrome/browser/chromeos/accessibility/magnification_manager.h" |
| 31 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h
" | 31 #include "chrome/browser/chromeos/arc/fileapi/arc_content_file_system_url_util.h
" |
| 32 #include "chrome/browser/chromeos/ash_config.h" |
| 32 #include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h" | 33 #include "chrome/browser/chromeos/background/ash_wallpaper_delegate.h" |
| 33 #include "chrome/browser/chromeos/display/display_configuration_observer.h" | 34 #include "chrome/browser/chromeos/display/display_configuration_observer.h" |
| 34 #include "chrome/browser/chromeos/display/display_preferences.h" | 35 #include "chrome/browser/chromeos/display/display_preferences.h" |
| 35 #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h" | 36 #include "chrome/browser/chromeos/policy/display_rotation_default_handler.h" |
| 36 #include "chrome/browser/chromeos/profiles/profile_helper.h" | 37 #include "chrome/browser/chromeos/profiles/profile_helper.h" |
| 37 #include "chrome/browser/chromeos/system/input_device_settings.h" | 38 #include "chrome/browser/chromeos/system/input_device_settings.h" |
| 38 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" | 39 #include "chrome/browser/chromeos/ui/accessibility_focus_ring_controller.h" |
| 39 #include "chrome/browser/lifetime/application_lifetime.h" | 40 #include "chrome/browser/lifetime/application_lifetime.h" |
| 40 #include "chrome/browser/profiles/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
| 41 #include "chrome/browser/profiles/profile_manager.h" | 42 #include "chrome/browser/profiles/profile_manager.h" |
| (...skipping 374 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 416 if (user) { | 417 if (user) { |
| 417 return chromeos::ProfileHelper::Get() | 418 return chromeos::ProfileHelper::Get() |
| 418 ->GetProfileByUser(user) | 419 ->GetProfileByUser(user) |
| 419 ->GetPrefs() | 420 ->GetPrefs() |
| 420 ->GetBoolean(prefs::kForceMaximizeOnFirstRun); | 421 ->GetBoolean(prefs::kForceMaximizeOnFirstRun); |
| 421 } | 422 } |
| 422 return false; | 423 return false; |
| 423 } | 424 } |
| 424 | 425 |
| 425 void ChromeShellDelegate::PreInit() { | 426 void ChromeShellDelegate::PreInit() { |
| 427 // TODO: port to mus. http://crbug.com/678949. |
| 428 if (chromeos::GetConfig() != ash::Config::CLASSIC) |
| 429 return; |
| 430 |
| 426 bool first_run_after_boot = base::CommandLine::ForCurrentProcess()->HasSwitch( | 431 bool first_run_after_boot = base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 427 chromeos::switches::kFirstExecAfterBoot); | 432 chromeos::switches::kFirstExecAfterBoot); |
| 428 chromeos::LoadDisplayPreferences(first_run_after_boot); | 433 chromeos::LoadDisplayPreferences(first_run_after_boot); |
| 429 // Object owns itself, and deletes itself when Observer::OnShutdown is called: | 434 // Object owns itself, and deletes itself when Observer::OnShutdown is called: |
| 430 new policy::DisplayRotationDefaultHandler(); | 435 new policy::DisplayRotationDefaultHandler(); |
| 431 // Set the observer now so that we can save the initial state | 436 // Set the observer now so that we can save the initial state |
| 432 // in Shell::Init. | 437 // in Shell::Init. |
| 433 display_configuration_observer_.reset( | 438 display_configuration_observer_.reset( |
| 434 new chromeos::DisplayConfigurationObserver()); | 439 new chromeos::DisplayConfigurationObserver()); |
| 435 } | 440 } |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 599 NOTREACHED() << "Unexpected notification " << type; | 604 NOTREACHED() << "Unexpected notification " << type; |
| 600 } | 605 } |
| 601 } | 606 } |
| 602 | 607 |
| 603 void ChromeShellDelegate::PlatformInit() { | 608 void ChromeShellDelegate::PlatformInit() { |
| 604 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, | 609 registrar_.Add(this, chrome::NOTIFICATION_LOGIN_USER_PROFILE_PREPARED, |
| 605 content::NotificationService::AllSources()); | 610 content::NotificationService::AllSources()); |
| 606 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, | 611 registrar_.Add(this, chrome::NOTIFICATION_SESSION_STARTED, |
| 607 content::NotificationService::AllSources()); | 612 content::NotificationService::AllSources()); |
| 608 } | 613 } |
| OLD | NEW |