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