| 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/views/ash/chrome_browser_main_extra_parts_ash.h" | 5 #include "chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/lazy_instance.h" | 10 #include "base/lazy_instance.h" |
| 11 #include "base/macros.h" | 11 #include "base/macros.h" |
| 12 #include "base/memory/ptr_util.h" | 12 #include "base/memory/ptr_util.h" |
| 13 #include "build/build_config.h" | 13 #include "build/build_config.h" |
| 14 #include "chrome/browser/chrome_browser_main.h" | 14 #include "chrome/browser/chrome_browser_main.h" |
| 15 #include "chrome/browser/ui/ash/ash_init.h" | 15 #include "chrome/browser/ui/ash/ash_init.h" |
| 16 #include "chrome/browser/ui/ash/ash_util.h" | 16 #include "chrome/browser/ui/ash/ash_util.h" |
| 17 #include "chrome/browser/ui/ash/cast_config_client_media_router.h" | 17 #include "chrome/browser/ui/ash/cast_config_client_media_router.h" |
| 18 #include "chrome/browser/ui/ash/chrome_new_window_client.h" | 18 #include "chrome/browser/ui/ash/chrome_new_window_client.h" |
| 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h" | 19 #include "chrome/browser/ui/ash/launcher/chrome_launcher_controller_mus.h" |
| 20 #include "chrome/browser/ui/ash/media_client.h" | 20 #include "chrome/browser/ui/ash/media_client.h" |
| 21 #include "chrome/browser/ui/views/ash/tab_scrubber.h" | 21 #include "chrome/browser/ui/views/ash/tab_scrubber.h" |
| 22 #include "chrome/browser/ui/views/chrome_browser_main_extra_parts_views.h" | |
| 23 #include "chrome/browser/ui/views/frame/immersive_context_mus.h" | 22 #include "chrome/browser/ui/views/frame/immersive_context_mus.h" |
| 24 #include "chrome/browser/ui/views/frame/immersive_handler_factory_mus.h" | 23 #include "chrome/browser/ui/views/frame/immersive_handler_factory_mus.h" |
| 25 #include "chrome/common/chrome_switches.h" | 24 #include "chrome/common/chrome_switches.h" |
| 26 #include "ui/aura/env.h" | 25 #include "ui/aura/env.h" |
| 27 #include "ui/keyboard/content/keyboard.h" | 26 #include "ui/keyboard/content/keyboard.h" |
| 28 #include "ui/keyboard/keyboard_controller.h" | 27 #include "ui/keyboard/keyboard_controller.h" |
| 29 #include "ui/wm/core/capture_controller.h" | |
| 30 #include "ui/wm/core/wm_state.h" | |
| 31 | 28 |
| 32 #if defined(OS_CHROMEOS) | 29 #if defined(OS_CHROMEOS) |
| 33 #include "chrome/browser/ui/ash/session_controller_client.h" | 30 #include "chrome/browser/ui/ash/session_controller_client.h" |
| 34 #include "chrome/browser/ui/ash/system_tray_client.h" | 31 #include "chrome/browser/ui/ash/system_tray_client.h" |
| 35 #include "chrome/browser/ui/ash/volume_controller.h" | 32 #include "chrome/browser/ui/ash/volume_controller.h" |
| 36 #include "chrome/browser/ui/ash/vpn_list_forwarder.h" | 33 #include "chrome/browser/ui/ash/vpn_list_forwarder.h" |
| 37 #include "chrome/browser/ui/views/select_file_dialog_extension.h" | 34 #include "chrome/browser/ui/views/select_file_dialog_extension.h" |
| 38 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" | 35 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" |
| 39 #endif // defined(OS_CHROMEOS) | 36 #endif // defined(OS_CHROMEOS) |
| 40 | 37 |
| 41 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh( | 38 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() {} |
| 42 ChromeBrowserMainExtraPartsViews* extra_parts_views) | |
| 43 : extra_parts_views_(extra_parts_views) {} | |
| 44 | 39 |
| 45 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {} | 40 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {} |
| 46 | 41 |
| 47 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { | 42 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { |
| 48 if (chrome::ShouldOpenAshOnStartup()) | 43 if (chrome::ShouldOpenAshOnStartup()) |
| 49 chrome::OpenAsh(gfx::kNullAcceleratedWidget); | 44 chrome::OpenAsh(gfx::kNullAcceleratedWidget); |
| 50 | 45 |
| 51 if (chrome::IsRunningInMash()) { | 46 if (chrome::IsRunningInMash()) { |
| 52 immersive_context_ = base::MakeUnique<ImmersiveContextMus>( | 47 immersive_context_ = base::MakeUnique<ImmersiveContextMus>(); |
| 53 extra_parts_views_->wm_state()->capture_controller()); | |
| 54 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); | 48 immersive_handler_factory_ = base::MakeUnique<ImmersiveHandlerFactoryMus>(); |
| 55 } | 49 } |
| 56 | 50 |
| 57 #if defined(OS_CHROMEOS) | 51 #if defined(OS_CHROMEOS) |
| 58 // TODO(xiyuan): Update after SesssionStateDelegate is deprecated. | 52 // TODO(xiyuan): Update after SesssionStateDelegate is deprecated. |
| 59 if (chrome::IsRunningInMash()) | 53 if (chrome::IsRunningInMash()) |
| 60 session_controller_client_ = base::MakeUnique<SessionControllerClient>(); | 54 session_controller_client_ = base::MakeUnique<SessionControllerClient>(); |
| 61 | 55 |
| 62 // Must be available at login screen, so initialize before profile. | 56 // Must be available at login screen, so initialize before profile. |
| 63 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); | 57 system_tray_client_ = base::MakeUnique<SystemTrayClient>(); |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 vpn_list_forwarder_.reset(); | 97 vpn_list_forwarder_.reset(); |
| 104 volume_controller_.reset(); | 98 volume_controller_.reset(); |
| 105 new_window_client_.reset(); | 99 new_window_client_.reset(); |
| 106 system_tray_client_.reset(); | 100 system_tray_client_.reset(); |
| 107 media_client_.reset(); | 101 media_client_.reset(); |
| 108 cast_config_client_media_router_.reset(); | 102 cast_config_client_media_router_.reset(); |
| 109 session_controller_client_.reset(); | 103 session_controller_client_.reset(); |
| 110 #endif | 104 #endif |
| 111 chrome::CloseAsh(); | 105 chrome::CloseAsh(); |
| 112 } | 106 } |
| OLD | NEW |