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/host/ash_remote_window_tree_host_win.h" |
10 #include "ash/shell.h" | 10 #include "ash/shell.h" |
(...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
115 // This will delete the MetroViewerProcessHost object. Don't access member | 115 // This will delete the MetroViewerProcessHost object. Don't access member |
116 // variables/functions after this call. | 116 // variables/functions after this call. |
117 g_browser_process->platform_part()->OnMetroViewerProcessTerminated(); | 117 g_browser_process->platform_part()->OnMetroViewerProcessTerminated(); |
118 } | 118 } |
119 | 119 |
120 void ChromeMetroViewerProcessHost::OnChannelConnected(int32_t /*peer_pid*/) { | 120 void ChromeMetroViewerProcessHost::OnChannelConnected(int32_t /*peer_pid*/) { |
121 DVLOG(1) << "ChromeMetroViewerProcessHost::OnChannelConnected: "; | 121 DVLOG(1) << "ChromeMetroViewerProcessHost::OnChannelConnected: "; |
122 // Set environment variable to let breakpad know that metro process was | 122 // Set environment variable to let breakpad know that metro process was |
123 // connected. | 123 // connected. |
124 ::SetEnvironmentVariableA(env_vars::kMetroConnected, "1"); | 124 ::SetEnvironmentVariableA(env_vars::kMetroConnected, "1"); |
125 | |
126 if (!content::GpuDataManager::GetInstance()->GpuAccessAllowed(NULL)) { | |
127 DVLOG(1) << "No GPU access, attempting to restart in Desktop\n"; | |
128 chrome::AttemptRestartToDesktopMode(); | |
129 } | |
130 } | 125 } |
131 | 126 |
132 void ChromeMetroViewerProcessHost::OnSetTargetSurface( | 127 void ChromeMetroViewerProcessHost::OnSetTargetSurface( |
133 gfx::NativeViewId target_surface, | 128 gfx::NativeViewId target_surface, |
134 float device_scale) { | 129 float device_scale) { |
135 HWND hwnd = reinterpret_cast<HWND>(target_surface); | 130 HWND hwnd = reinterpret_cast<HWND>(target_surface); |
136 | 131 |
137 gfx::SetDefaultDeviceScaleFactor(device_scale); | 132 gfx::SetDefaultDeviceScaleFactor(device_scale); |
138 chrome::OpenAsh(hwnd); | 133 chrome::OpenAsh(hwnd); |
139 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); | 134 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
(...skipping 30 matching lines...) Expand all Loading... |
170 void ChromeMetroViewerProcessHost::OnWindowSizeChanged(uint32_t width, | 165 void ChromeMetroViewerProcessHost::OnWindowSizeChanged(uint32_t width, |
171 uint32_t height) { | 166 uint32_t height) { |
172 std::vector<ash::DisplayInfo> info_list; | 167 std::vector<ash::DisplayInfo> info_list; |
173 info_list.push_back(ash::DisplayInfo::CreateFromSpec( | 168 info_list.push_back(ash::DisplayInfo::CreateFromSpec( |
174 base::StringPrintf("%dx%d*%f", width, height, gfx::GetDPIScale()))); | 169 base::StringPrintf("%dx%d*%f", width, height, gfx::GetDPIScale()))); |
175 ash::Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged( | 170 ash::Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged( |
176 info_list); | 171 info_list); |
177 aura::RemoteWindowTreeHostWin::Instance()->HandleWindowSizeChanged(width, | 172 aura::RemoteWindowTreeHostWin::Instance()->HandleWindowSizeChanged(width, |
178 height); | 173 height); |
179 } | 174 } |
OLD | NEW |