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 15 matching lines...) Expand all Loading... |
26 #include "chrome/browser/ui/browser_window.h" | 26 #include "chrome/browser/ui/browser_window.h" |
27 #include "chrome/browser/ui/host_desktop.h" | 27 #include "chrome/browser/ui/host_desktop.h" |
28 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 28 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
29 #include "chrome/common/env_vars.h" | 29 #include "chrome/common/env_vars.h" |
30 #include "components/search_engines/util.h" | 30 #include "components/search_engines/util.h" |
31 #include "content/public/browser/browser_thread.h" | 31 #include "content/public/browser/browser_thread.h" |
32 #include "content/public/browser/gpu_data_manager.h" | 32 #include "content/public/browser/gpu_data_manager.h" |
33 #include "content/public/browser/notification_service.h" | 33 #include "content/public/browser/notification_service.h" |
34 #include "content/public/browser/page_navigator.h" | 34 #include "content/public/browser/page_navigator.h" |
35 #include "content/public/browser/web_contents.h" | 35 #include "content/public/browser/web_contents.h" |
| 36 #include "content/public/common/child_process_host.h" |
36 #include "ui/aura/remote_window_tree_host_win.h" | 37 #include "ui/aura/remote_window_tree_host_win.h" |
37 #include "ui/gfx/win/dpi.h" | 38 #include "ui/gfx/win/dpi.h" |
38 #include "ui/metro_viewer/metro_viewer_messages.h" | 39 #include "ui/metro_viewer/metro_viewer_messages.h" |
39 #include "url/gurl.h" | 40 #include "url/gurl.h" |
40 | 41 |
41 namespace { | 42 namespace { |
42 | 43 |
43 void CloseOpenAshBrowsers() { | 44 void CloseOpenAshBrowsers() { |
44 BrowserList* browser_list = | 45 BrowserList* browser_list = |
45 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); | 46 BrowserList::GetInstance(chrome::HOST_DESKTOP_TYPE_ASH); |
(...skipping 18 matching lines...) Expand all Loading... |
64 params.disposition = NEW_FOREGROUND_TAB; | 65 params.disposition = NEW_FOREGROUND_TAB; |
65 params.host_desktop_type = chrome::HOST_DESKTOP_TYPE_ASH; | 66 params.host_desktop_type = chrome::HOST_DESKTOP_TYPE_ASH; |
66 chrome::Navigate(¶ms); | 67 chrome::Navigate(¶ms); |
67 } | 68 } |
68 | 69 |
69 } // namespace | 70 } // namespace |
70 | 71 |
71 ChromeMetroViewerProcessHost::ChromeMetroViewerProcessHost() | 72 ChromeMetroViewerProcessHost::ChromeMetroViewerProcessHost() |
72 : MetroViewerProcessHost( | 73 : MetroViewerProcessHost( |
73 content::BrowserThread::GetMessageLoopProxyForThread( | 74 content::BrowserThread::GetMessageLoopProxyForThread( |
74 content::BrowserThread::IO)) { | 75 content::BrowserThread::IO), |
| 76 content::ChildProcessHost::GetAttachmentBroker()) { |
75 chrome::IncrementKeepAliveCount(); | 77 chrome::IncrementKeepAliveCount(); |
76 } | 78 } |
77 | 79 |
78 ChromeMetroViewerProcessHost::~ChromeMetroViewerProcessHost() { | 80 ChromeMetroViewerProcessHost::~ChromeMetroViewerProcessHost() { |
79 } | 81 } |
80 | 82 |
81 void ChromeMetroViewerProcessHost::OnChannelError() { | 83 void ChromeMetroViewerProcessHost::OnChannelError() { |
82 // TODO(cpu): At some point we only close the browser. Right now this | 84 // TODO(cpu): At some point we only close the browser. Right now this |
83 // is very convenient for developing. | 85 // is very convenient for developing. |
84 DVLOG(1) << "viewer channel error : Quitting browser"; | 86 DVLOG(1) << "viewer channel error : Quitting browser"; |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 void ChromeMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, | 171 void ChromeMetroViewerProcessHost::OnWindowSizeChanged(uint32 width, |
170 uint32 height) { | 172 uint32 height) { |
171 std::vector<ash::DisplayInfo> info_list; | 173 std::vector<ash::DisplayInfo> info_list; |
172 info_list.push_back(ash::DisplayInfo::CreateFromSpec( | 174 info_list.push_back(ash::DisplayInfo::CreateFromSpec( |
173 base::StringPrintf("%dx%d*%f", width, height, gfx::GetDPIScale()))); | 175 base::StringPrintf("%dx%d*%f", width, height, gfx::GetDPIScale()))); |
174 ash::Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged( | 176 ash::Shell::GetInstance()->display_manager()->OnNativeDisplaysChanged( |
175 info_list); | 177 info_list); |
176 aura::RemoteWindowTreeHostWin::Instance()->HandleWindowSizeChanged(width, | 178 aura::RemoteWindowTreeHostWin::Instance()->HandleWindowSizeChanged(width, |
177 height); | 179 height); |
178 } | 180 } |
OLD | NEW |