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

Side by Side Diff: chrome/browser/ui/views/ash/chrome_browser_main_extra_parts_ash.cc

Issue 1608733002: Remove ui/gfx/screen_type_delegate.h (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@metro-mode-4
Patch Set: and another rebase Created 4 years, 11 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
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 "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/session/session_state_delegate.h" 8 #include "ash/session/session_state_delegate.h"
9 #include "ash/shell.h" 9 #include "ash/shell.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/lazy_instance.h" 11 #include "base/lazy_instance.h"
12 #include "base/macros.h" 12 #include "base/macros.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/views/ash/tab_scrubber.h" 17 #include "chrome/browser/ui/views/ash/tab_scrubber.h"
18 #include "chrome/common/chrome_switches.h" 18 #include "chrome/common/chrome_switches.h"
19 #include "ui/aura/env.h" 19 #include "ui/aura/env.h"
20 #include "ui/gfx/screen.h" 20 #include "ui/gfx/screen.h"
21 #include "ui/gfx/screen_type_delegate.h"
22 #include "ui/keyboard/content/keyboard.h" 21 #include "ui/keyboard/content/keyboard.h"
23 #include "ui/keyboard/keyboard_controller.h" 22 #include "ui/keyboard/keyboard_controller.h"
24 23
25 #if defined(OS_CHROMEOS) 24 #if defined(OS_CHROMEOS)
26 #include "chrome/browser/ui/views/select_file_dialog_extension.h" 25 #include "chrome/browser/ui/views/select_file_dialog_extension.h"
27 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h" 26 #include "chrome/browser/ui/views/select_file_dialog_extension_factory.h"
28 #endif 27 #endif
29 28
30 #if !defined(OS_CHROMEOS)
31 class ScreenTypeDelegateWin : public gfx::ScreenTypeDelegate {
32 public:
33 ScreenTypeDelegateWin() {}
34 gfx::ScreenType GetScreenTypeForNativeView(gfx::NativeView view) override {
35 return chrome::IsNativeViewInAsh(view) ?
36 gfx::SCREEN_TYPE_ALTERNATE :
37 gfx::SCREEN_TYPE_NATIVE;
38 }
39 private:
40 DISALLOW_COPY_AND_ASSIGN(ScreenTypeDelegateWin);
41 };
42 #endif // !OS_CHROMEOS
43
44 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() { 29 ChromeBrowserMainExtraPartsAsh::ChromeBrowserMainExtraPartsAsh() {
45 } 30 }
46 31
47 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() { 32 ChromeBrowserMainExtraPartsAsh::~ChromeBrowserMainExtraPartsAsh() {
48 } 33 }
49 34
50 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() { 35 void ChromeBrowserMainExtraPartsAsh::PreProfileInit() {
51 if (chrome::ShouldOpenAshOnStartup()) { 36 if (chrome::ShouldOpenAshOnStartup()) {
52 chrome::OpenAsh(gfx::kNullAcceleratedWidget); 37 chrome::OpenAsh(gfx::kNullAcceleratedWidget);
53 38
54 #if defined(OS_LINUX) && !defined(OS_CHROMEOS) 39 #if defined(OS_LINUX) && !defined(OS_CHROMEOS)
55 ash::Shell::GetInstance()->CreateShelf(); 40 ash::Shell::GetInstance()->CreateShelf();
56 ash::Shell::GetInstance()->ShowShelf(); 41 ash::Shell::GetInstance()->ShowShelf();
57 #endif 42 #endif
58 } else {
59 #if !defined(OS_CHROMEOS)
60 gfx::Screen::SetScreenTypeDelegate(new ScreenTypeDelegateWin);
61 #endif
62 } 43 }
63 #if defined(OS_CHROMEOS) 44 #if defined(OS_CHROMEOS)
64 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile 45 // For OS_CHROMEOS, virtual keyboard needs to be initialized before profile
65 // initialized. Otherwise, virtual keyboard extension will not load at login 46 // initialized. Otherwise, virtual keyboard extension will not load at login
66 // screen. 47 // screen.
67 keyboard::InitializeKeyboard(); 48 keyboard::InitializeKeyboard();
68 #endif 49 #endif
69 50
70 #if defined(OS_CHROMEOS) 51 #if defined(OS_CHROMEOS)
71 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory); 52 ui::SelectFileDialog::SetFactory(new SelectFileDialogExtensionFactory);
72 #endif 53 #endif
73 } 54 }
74 55
75 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() { 56 void ChromeBrowserMainExtraPartsAsh::PostProfileInit() {
76 if (!ash::Shell::HasInstance()) 57 if (!ash::Shell::HasInstance())
77 return; 58 return;
78 59
79 // Initialize TabScrubber after the Ash Shell has been initialized. 60 // Initialize TabScrubber after the Ash Shell has been initialized.
80 TabScrubber::GetInstance(); 61 TabScrubber::GetInstance();
81 // Activate virtual keyboard after profile is initialized. It depends on the 62 // Activate virtual keyboard after profile is initialized. It depends on the
82 // default profile. 63 // default profile.
83 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard( 64 ash::Shell::GetPrimaryRootWindowController()->ActivateKeyboard(
84 keyboard::KeyboardController::GetInstance()); 65 keyboard::KeyboardController::GetInstance());
85 } 66 }
86 67
87 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() { 68 void ChromeBrowserMainExtraPartsAsh::PostMainMessageLoopRun() {
88 chrome::CloseAsh(); 69 chrome::CloseAsh();
89 } 70 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/app_list/win/app_list_win.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698