| 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/chrome_browser_main_extra_parts_ash.h" | 5 #include "chrome/browser/chrome_browser_main_extra_parts_ash.h" |
| 6 | 6 |
| 7 #include "ash/accelerators/accelerator_controller.h" | 7 #include "ash/accelerators/accelerator_controller.h" |
| 8 #include "ash/ash_switches.h" | 8 #include "ash/ash_switches.h" |
| 9 #include "ash/shell.h" | 9 #include "ash/shell.h" |
| 10 #include "ash/wm/key_rewriter_event_filter.h" | 10 #include "ash/wm/key_rewriter_event_filter.h" |
| 11 #include "base/command_line.h" | 11 #include "base/command_line.h" |
| 12 #include "chrome/common/chrome_switches.h" | 12 #include "chrome/common/chrome_switches.h" |
| 13 #include "chrome/browser/ui/browser_list.h" | 13 #include "chrome/browser/ui/browser_list.h" |
| 14 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" | 14 #include "chrome/browser/ui/views/ash/caps_lock_handler.h" |
| 15 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" | 15 #include "chrome/browser/ui/views/ash/chrome_shell_delegate.h" |
| 16 #include "chrome/browser/ui/views/ash/key_rewriter.h" | 16 #include "chrome/browser/ui/views/ash/key_rewriter.h" |
| 17 #include "chrome/browser/ui/views/ash/screen_orientation_listener.h" | 17 #include "chrome/browser/ui/views/ash/screen_orientation_listener.h" |
| 18 #include "chrome/browser/ui/views/ash/screenshot_taker.h" | 18 #include "chrome/browser/ui/views/ash/screenshot_taker.h" |
| 19 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" | 19 #include "chrome/browser/ui/views/ash/status_area_host_aura.h" |
| 20 #include "ui/aura/env.h" | 20 #include "ui/aura/env.h" |
| 21 #include "ui/aura/aura_switches.h" | 21 #include "ui/aura/aura_switches.h" |
| 22 #include "ui/aura/monitor_manager.h" | 22 #include "ui/aura/monitor_manager.h" |
| 23 #include "ui/aura/root_window.h" | 23 #include "ui/aura/root_window.h" |
| 24 #include "ui/gfx/compositor/compositor_setup.h" | 24 #include "ui/gfx/compositor/compositor_setup.h" |
| 25 | 25 |
| 26 #if defined(OS_CHROMEOS) | 26 #if defined(OS_CHROMEOS) |
| 27 #include "base/chromeos/chromeos_version.h" | 27 #include "base/chromeos/chromeos_version.h" |
| 28 #include "chrome/browser/battery_status_provider_chromeos.h" |
| 28 #include "chrome/browser/ui/views/ash/brightness_controller_chromeos.h" | 29 #include "chrome/browser/ui/views/ash/brightness_controller_chromeos.h" |
| 29 #include "chrome/browser/ui/views/ash/ime_controller_chromeos.h" | 30 #include "chrome/browser/ui/views/ash/ime_controller_chromeos.h" |
| 30 #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" | 31 #include "chrome/browser/ui/views/ash/volume_controller_chromeos.h" |
| 31 #include "chrome/browser/chromeos/input_method/input_method_manager.h" | 32 #include "chrome/browser/chromeos/input_method/input_method_manager.h" |
| 32 #include "chrome/browser/chromeos/login/user_manager.h" | 33 #include "chrome/browser/chromeos/login/user_manager.h" |
| 33 #endif | 34 #endif |
| 34 | 35 |
| 35 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() | 36 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() |
| 36 : ChromeBrowserMainExtraParts() { | 37 : ChromeBrowserMainExtraParts() { |
| 37 } | 38 } |
| (...skipping 30 matching lines...) Expand all Loading... |
| 68 shell->accelerator_controller()->SetVolumeControlDelegate( | 69 shell->accelerator_controller()->SetVolumeControlDelegate( |
| 69 scoped_ptr<ash::VolumeControlDelegate>(new VolumeController).Pass()); | 70 scoped_ptr<ash::VolumeControlDelegate>(new VolumeController).Pass()); |
| 70 | 71 |
| 71 if (!CommandLine::ForCurrentProcess()->HasSwitch( | 72 if (!CommandLine::ForCurrentProcess()->HasSwitch( |
| 72 switches::kDisableZeroBrowsersOpenForTests)) | 73 switches::kDisableZeroBrowsersOpenForTests)) |
| 73 BrowserList::StartKeepAlive(); | 74 BrowserList::StartKeepAlive(); |
| 74 #endif | 75 #endif |
| 75 | 76 |
| 76 // Make sure the singleton ScreenOrientationListener object is created. | 77 // Make sure the singleton ScreenOrientationListener object is created. |
| 77 ScreenOrientationListener::GetInstance(); | 78 ScreenOrientationListener::GetInstance(); |
| 79 |
| 80 #if defined(OS_CHROMEOS) |
| 81 // Make sure the singleton BatteryStatusProviderChromeos object is created. |
| 82 BatteryStatusProviderChromeos::GetInstance(); |
| 83 #endif |
| 78 } | 84 } |
| 79 | 85 |
| 80 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { | 86 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { |
| 81 // Add the status area buttons after Profile has been initialized. | 87 // Add the status area buttons after Profile has been initialized. |
| 82 if (CommandLine::ForCurrentProcess()->HasSwitch( | 88 if (CommandLine::ForCurrentProcess()->HasSwitch( |
| 83 ash::switches::kDisableAshUberTray)) { | 89 ash::switches::kDisableAshUberTray)) { |
| 84 ChromeShellDelegate::instance()->status_area_host()->AddButtons(); | 90 ChromeShellDelegate::instance()->status_area_host()->AddButtons(); |
| 85 } | 91 } |
| 86 } | 92 } |
| 87 | 93 |
| 88 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { | 94 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { |
| 89 ash::Shell::DeleteInstance(); | 95 ash::Shell::DeleteInstance(); |
| 90 } | 96 } |
| OLD | NEW |