| 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/lifetime/application_lifetime.h" | 9 #include "chrome/browser/lifetime/application_lifetime.h" |
| 10 #include "chrome/browser/ui/ash/ash_init.h" | 10 #include "chrome/browser/ui/ash/ash_init.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 IPC_MESSAGE_UNHANDLED(handled = false) | 47 IPC_MESSAGE_UNHANDLED(handled = false) |
| 48 IPC_END_MESSAGE_MAP() | 48 IPC_END_MESSAGE_MAP() |
| 49 return handled; | 49 return handled; |
| 50 } | 50 } |
| 51 | 51 |
| 52 void MetroViewerProcessHost::OnChannelError() { | 52 void MetroViewerProcessHost::OnChannelError() { |
| 53 // TODO(cpu): At some point we only close the browser. Right now this | 53 // TODO(cpu): At some point we only close the browser. Right now this |
| 54 // is very convenient for developing. | 54 // is very convenient for developing. |
| 55 DLOG(INFO) << "viewer channel error : Quitting browser"; | 55 DLOG(INFO) << "viewer channel error : Quitting browser"; |
| 56 g_browser_process->ReleaseModule(); | 56 g_browser_process->ReleaseModule(); |
| 57 browser::CloseAllBrowsersOfType(chrome::HOST_DESKTOP_TYPE_ASH); |
| 57 chrome::CloseAsh(); | 58 chrome::CloseAsh(); |
| 58 } | 59 } |
| 59 | 60 |
| 60 void MetroViewerProcessHost::OnSetTargetSurface( | 61 void MetroViewerProcessHost::OnSetTargetSurface( |
| 61 gfx::NativeViewId target_surface) { | 62 gfx::NativeViewId target_surface) { |
| 62 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; | 63 DLOG(INFO) << __FUNCTION__ << ", target_surface = " << target_surface; |
| 63 HWND hwnd = reinterpret_cast<HWND>(target_surface); | 64 HWND hwnd = reinterpret_cast<HWND>(target_surface); |
| 64 | 65 |
| 65 chrome::OpenAsh(); | 66 chrome::OpenAsh(); |
| 66 | 67 |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 102 uint32 scan_code, | 103 uint32 scan_code, |
| 103 uint32 flags) { | 104 uint32 flags) { |
| 104 aura::RemoteRootWindowHostWin::Instance()->OnChar( | 105 aura::RemoteRootWindowHostWin::Instance()->OnChar( |
| 105 key_code, repeat_count, scan_code, flags); | 106 key_code, repeat_count, scan_code, flags); |
| 106 } | 107 } |
| 107 | 108 |
| 108 void MetroViewerProcessHost::OnVisibilityChanged(bool visible) { | 109 void MetroViewerProcessHost::OnVisibilityChanged(bool visible) { |
| 109 aura::RemoteRootWindowHostWin::Instance()->OnVisibilityChanged( | 110 aura::RemoteRootWindowHostWin::Instance()->OnVisibilityChanged( |
| 110 visible); | 111 visible); |
| 111 } | 112 } |
| OLD | NEW |