OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/metro_viewer/chrome_metro_viewer_process_host_aurawin.h
" | 5 #include "chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.h
" |
6 | 6 |
7 #include "ash/display/display_info.h" | 7 #include "ash/display/display_info.h" |
8 #include "ash/display/display_manager.h" | 8 #include "ash/display/display_manager.h" |
| 9 #include "ash/host/ash_remote_window_tree_host_win.h" |
9 #include "ash/shell.h" | 10 #include "ash/shell.h" |
10 #include "ash/wm/window_positioner.h" | 11 #include "ash/wm/window_positioner.h" |
11 #include "base/logging.h" | 12 #include "base/logging.h" |
12 #include "base/memory/ref_counted.h" | 13 #include "base/memory/ref_counted.h" |
13 #include "base/strings/stringprintf.h" | 14 #include "base/strings/stringprintf.h" |
14 #include "chrome/browser/browser_process.h" | 15 #include "chrome/browser/browser_process.h" |
15 #include "chrome/browser/browser_process_platform_part_aurawin.h" | 16 #include "chrome/browser/browser_process_platform_part_aurawin.h" |
16 #include "chrome/browser/browser_shutdown.h" | 17 #include "chrome/browser/browser_shutdown.h" |
17 #include "chrome/browser/chrome_notification_types.h" | 18 #include "chrome/browser/chrome_notification_types.h" |
18 #include "chrome/browser/lifetime/application_lifetime.h" | 19 #include "chrome/browser/lifetime/application_lifetime.h" |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
110 | 111 |
111 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { | 112 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { |
112 DVLOG(1) << "No GPU access, attempting to restart in Desktop\n"; | 113 DVLOG(1) << "No GPU access, attempting to restart in Desktop\n"; |
113 chrome::AttemptRestartToDesktopMode(); | 114 chrome::AttemptRestartToDesktopMode(); |
114 } | 115 } |
115 } | 116 } |
116 | 117 |
117 void ChromeMetroViewerProcessHost::OnSetTargetSurface( | 118 void ChromeMetroViewerProcessHost::OnSetTargetSurface( |
118 gfx::NativeViewId target_surface) { | 119 gfx::NativeViewId target_surface) { |
119 HWND hwnd = reinterpret_cast<HWND>(target_surface); | 120 HWND hwnd = reinterpret_cast<HWND>(target_surface); |
| 121 |
120 // Make hwnd available as early as possible for proper InputMethod | 122 // Make hwnd available as early as possible for proper InputMethod |
121 // initialization. | 123 // initialization. |
| 124 ash::AshRemoteWindowTreeHostWin::Init(); |
122 aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd); | 125 aura::RemoteWindowTreeHostWin::Instance()->SetRemoteWindowHandle(hwnd); |
123 | 126 |
124 // Now start the Ash shell environment. | 127 // Now start the Ash shell environment. |
125 chrome::OpenAsh(); | 128 chrome::OpenAsh(); |
126 ash::Shell::GetInstance()->CreateShelf(); | 129 ash::Shell::GetInstance()->CreateShelf(); |
127 ash::Shell::GetInstance()->ShowShelf(); | 130 ash::Shell::GetInstance()->ShowShelf(); |
128 | 131 |
129 // Tell our root window host that the viewer has connected. | 132 // Tell our root window host that the viewer has connected. |
130 aura::RemoteWindowTreeHostWin::Instance()->Connected(this); | 133 aura::RemoteWindowTreeHostWin::Instance()->Connected(this); |
131 | 134 |
(...skipping 22 matching lines...) Expand all Loading... |
154 void ChromeMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, | 157 void ChromeMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, |
155 uint32 height) { | 158 uint32 height) { |
156 std::vector<ash::DisplayInfo> info_list; | 159 std::vector<ash::DisplayInfo> info_list; |
157 info_list.push_back(ash::DisplayInfo::CreateFromSpec( | 160 info_list.push_back(ash::DisplayInfo::CreateFromSpec( |
158 base::StringPrintf("%dx%d*%f", width, height, gfx::GetModernUIScale()))); | 161 base::StringPrintf("%dx%d*%f", width, height, gfx::GetModernUIScale()))); |
159 ash::Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged( | 162 ash::Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged( |
160 info_list); | 163 info_list); |
161 aura::RemoteWindowTreeHostWin::Instance()->HandleWindowSizeChanged(width, | 164 aura::RemoteWindowTreeHostWin::Instance()->HandleWindowSizeChanged(width, |
162 height); | 165 height); |
163 } | 166 } |
OLD | NEW |