| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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 "ui/aura/remote_root_window_host_win.h" | 5 #include "ui/aura/remote_root_window_host_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 124 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 135 on_failure); | 135 on_failure); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void HandleActivateDesktop(const base::FilePath& shortcut, | 138 void HandleActivateDesktop(const base::FilePath& shortcut, |
| 139 bool ash_exit) { | 139 bool ash_exit) { |
| 140 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); | 140 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
| 141 aura::RemoteWindowTreeHostWin::Instance()->HandleActivateDesktop(shortcut, | 141 aura::RemoteWindowTreeHostWin::Instance()->HandleActivateDesktop(shortcut, |
| 142 ash_exit); | 142 ash_exit); |
| 143 } | 143 } |
| 144 | 144 |
| 145 void HandleMetroExit() { |
| 146 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
| 147 aura::RemoteWindowTreeHostWin::Instance()->HandleMetroExit(); |
| 148 } |
| 149 |
| 145 RemoteWindowTreeHostWin* g_instance = NULL; | 150 RemoteWindowTreeHostWin* g_instance = NULL; |
| 146 | 151 |
| 147 RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Instance() { | 152 RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Instance() { |
| 148 if (g_instance) | 153 if (g_instance) |
| 149 return g_instance; | 154 return g_instance; |
| 150 return Create(gfx::Rect()); | 155 return Create(gfx::Rect()); |
| 151 } | 156 } |
| 152 | 157 |
| 153 RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Create( | 158 RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Create( |
| 154 const gfx::Rect& bounds) { | 159 const gfx::Rect& bounds) { |
| (...skipping 87 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 } | 247 } |
| 243 | 248 |
| 244 void RemoteWindowTreeHostWin::HandleActivateDesktop( | 249 void RemoteWindowTreeHostWin::HandleActivateDesktop( |
| 245 const base::FilePath& shortcut, | 250 const base::FilePath& shortcut, |
| 246 bool ash_exit) { | 251 bool ash_exit) { |
| 247 if (!host_) | 252 if (!host_) |
| 248 return; | 253 return; |
| 249 host_->Send(new MetroViewerHostMsg_ActivateDesktop(shortcut, ash_exit)); | 254 host_->Send(new MetroViewerHostMsg_ActivateDesktop(shortcut, ash_exit)); |
| 250 } | 255 } |
| 251 | 256 |
| 257 void RemoteWindowTreeHostWin::HandleMetroExit() { |
| 258 if (!host_) |
| 259 return; |
| 260 host_->Send(new MetroViewerHostMsg_MetroExit()); |
| 261 } |
| 262 |
| 252 void RemoteWindowTreeHostWin::HandleOpenFile( | 263 void RemoteWindowTreeHostWin::HandleOpenFile( |
| 253 const base::string16& title, | 264 const base::string16& title, |
| 254 const base::FilePath& default_path, | 265 const base::FilePath& default_path, |
| 255 const base::string16& filter, | 266 const base::string16& filter, |
| 256 const OpenFileCompletion& on_success, | 267 const OpenFileCompletion& on_success, |
| 257 const FileSelectionCanceled& on_failure) { | 268 const FileSelectionCanceled& on_failure) { |
| 258 if (!host_) | 269 if (!host_) |
| 259 return; | 270 return; |
| 260 | 271 |
| 261 // Can only have one of these operations in flight. | 272 // Can only have one of these operations in flight. |
| (...skipping 464 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 726 } | 737 } |
| 727 | 738 |
| 728 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { | 739 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
| 729 if (flags == event_flags_) | 740 if (flags == event_flags_) |
| 730 return; | 741 return; |
| 731 event_flags_ = flags; | 742 event_flags_ = flags; |
| 732 SetVirtualKeyStates(event_flags_); | 743 SetVirtualKeyStates(event_flags_); |
| 733 } | 744 } |
| 734 | 745 |
| 735 } // namespace aura | 746 } // namespace aura |
| OLD | NEW |