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/metro_viewer_process_host_win.h" | 5 #include "chrome/browser/metro_viewer/metro_viewer_process_host_win.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "chrome/browser/browser_process.h" | 8 #include "chrome/browser/browser_process.h" |
9 #include "chrome/browser/browser_process_platform_part_aurawin.h" | |
10 #include "chrome/browser/ui/ash/ash_init.h" | 9 #include "chrome/browser/ui/ash/ash_init.h" |
11 #include "chrome/browser/ui/browser.h" | 10 #include "chrome/browser/ui/browser.h" |
12 #include "chrome/browser/ui/browser_list.h" | 11 #include "chrome/browser/ui/browser_list.h" |
13 #include "chrome/browser/ui/browser_window.h" | 12 #include "chrome/browser/ui/browser_window.h" |
14 #include "chrome/browser/ui/host_desktop.h" | 13 #include "chrome/browser/ui/host_desktop.h" |
15 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 14 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
16 #include "chrome/common/chrome_notification_types.h" | 15 #include "chrome/common/chrome_notification_types.h" |
17 #include "content/public/browser/browser_thread.h" | 16 #include "content/public/browser/browser_thread.h" |
18 #include "content/public/browser/notification_service.h" | 17 #include "content/public/browser/notification_service.h" |
19 #include "content/public/browser/web_contents.h" | 18 #include "content/public/browser/web_contents.h" |
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
81 CloseOpenAshBrowsers(); | 80 CloseOpenAshBrowsers(); |
82 chrome::CloseAsh(); | 81 chrome::CloseAsh(); |
83 // Tell the rest of Chrome about it. | 82 // Tell the rest of Chrome about it. |
84 content::NotificationService::current()->Notify( | 83 content::NotificationService::current()->Notify( |
85 chrome::NOTIFICATION_ASH_SESSION_ENDED, | 84 chrome::NOTIFICATION_ASH_SESSION_ENDED, |
86 content::NotificationService::AllSources(), | 85 content::NotificationService::AllSources(), |
87 content::NotificationService::NoDetails()); | 86 content::NotificationService::NoDetails()); |
88 | 87 |
89 // This will delete the MetroViewerProcessHost object. Don't access member | 88 // This will delete the MetroViewerProcessHost object. Don't access member |
90 // variables/functions after this call. | 89 // variables/functions after this call. |
91 g_browser_process->platform_part()->OnMetroViewerProcessTerminated(); | 90 g_browser_process->OnMetroViewerProcessTerminated(); |
92 } | 91 } |
93 | 92 |
94 void MetroViewerProcessHost::OnSetTargetSurface( | 93 void MetroViewerProcessHost::OnSetTargetSurface( |
95 gfx::NativeViewId target_surface) { | 94 gfx::NativeViewId target_surface) { |
96 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; | 95 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; |
97 HWND hwnd = reinterpret_cast<HWND>(target_surface); | 96 HWND hwnd = reinterpret_cast<HWND>(target_surface); |
98 chrome::OpenAsh(); | 97 chrome::OpenAsh(); |
99 scoped_refptr<AcceleratedPresenter> any_window = | 98 scoped_refptr<AcceleratedPresenter> any_window = |
100 AcceleratedPresenter::GetForWindow(NULL); | 99 AcceleratedPresenter::GetForWindow(NULL); |
101 any_window->SetNewTargetWindow(hwnd); | 100 any_window->SetNewTargetWindow(hwnd); |
102 aura::RemoteRootWindowHostWin::Instance()->Connected(this); | 101 aura::RemoteRootWindowHostWin::Instance()->Connected(this); |
103 // Tell the rest of Chrome that Ash is running. | 102 // Tell the rest of Chrome that Ash is running. |
104 content::NotificationService::current()->Notify( | 103 content::NotificationService::current()->Notify( |
105 chrome::NOTIFICATION_ASH_SESSION_STARTED, | 104 chrome::NOTIFICATION_ASH_SESSION_STARTED, |
106 content::NotificationService::AllSources(), | 105 content::NotificationService::AllSources(), |
107 content::NotificationService::NoDetails()); | 106 content::NotificationService::NoDetails()); |
108 } | 107 } |
OLD | NEW |