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

Side by Side Diff: chrome/browser/metro_viewer/chrome_metro_viewer_process_host_aurawin.cc

Issue 201573015: Introdcue AshWindowTreeHost and move ash/chrome specific code in WTH to ash. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 6 years, 8 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 | Annotate | Revision Log
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
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 }
OLDNEW
« no previous file with comments | « ash/wm/window_manager_unittest.cc ('k') | chrome/browser/ui/ash/chrome_shell_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698