| 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_window_tree_host_win.h" | 5 #include "ui/aura/remote_window_tree_host_win.h" |
| 6 | 6 |
| 7 #include <windows.h> | 7 #include <windows.h> |
| 8 | 8 |
| 9 #include <algorithm> | 9 #include <algorithm> |
| 10 | 10 |
| (...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 128 | 128 |
| 129 void HandleSelectFolder(const base::string16& title, | 129 void HandleSelectFolder(const base::string16& title, |
| 130 const SelectFolderCompletion& on_success, | 130 const SelectFolderCompletion& on_success, |
| 131 const FileSelectionCanceled& on_failure) { | 131 const FileSelectionCanceled& on_failure) { |
| 132 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); | 132 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
| 133 aura::RemoteWindowTreeHostWin::Instance()->HandleSelectFolder(title, | 133 aura::RemoteWindowTreeHostWin::Instance()->HandleSelectFolder(title, |
| 134 on_success, | 134 on_success, |
| 135 on_failure); | 135 on_failure); |
| 136 } | 136 } |
| 137 | 137 |
| 138 void HandleActivateDesktop(const base::FilePath& shortcut, | |
| 139 bool ash_exit) { | |
| 140 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); | |
| 141 aura::RemoteWindowTreeHostWin::Instance()->HandleActivateDesktop(shortcut, | |
| 142 ash_exit); | |
| 143 } | |
| 144 | |
| 145 void HandleMetroExit() { | 138 void HandleMetroExit() { |
| 146 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); | 139 DCHECK(aura::RemoteWindowTreeHostWin::Instance()); |
| 147 aura::RemoteWindowTreeHostWin::Instance()->HandleMetroExit(); | 140 aura::RemoteWindowTreeHostWin::Instance()->HandleMetroExit(); |
| 148 } | 141 } |
| 149 | 142 |
| 150 RemoteWindowTreeHostWin* g_instance = NULL; | 143 RemoteWindowTreeHostWin* g_instance = NULL; |
| 151 | 144 |
| 152 // static | 145 // static |
| 153 RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Instance() { | 146 RemoteWindowTreeHostWin* RemoteWindowTreeHostWin::Instance() { |
| 154 return g_instance; | 147 return g_instance; |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 246 } | 239 } |
| 247 | 240 |
| 248 void RemoteWindowTreeHostWin::HandleOpenURLOnDesktop( | 241 void RemoteWindowTreeHostWin::HandleOpenURLOnDesktop( |
| 249 const base::FilePath& shortcut, | 242 const base::FilePath& shortcut, |
| 250 const base::string16& url) { | 243 const base::string16& url) { |
| 251 if (!host_) | 244 if (!host_) |
| 252 return; | 245 return; |
| 253 host_->Send(new MetroViewerHostMsg_OpenURLOnDesktop(shortcut, url)); | 246 host_->Send(new MetroViewerHostMsg_OpenURLOnDesktop(shortcut, url)); |
| 254 } | 247 } |
| 255 | 248 |
| 256 void RemoteWindowTreeHostWin::HandleActivateDesktop( | |
| 257 const base::FilePath& shortcut, | |
| 258 bool ash_exit) { | |
| 259 if (!host_) | |
| 260 return; | |
| 261 host_->Send(new MetroViewerHostMsg_ActivateDesktop(shortcut, ash_exit)); | |
| 262 } | |
| 263 | |
| 264 void RemoteWindowTreeHostWin::HandleMetroExit() { | 249 void RemoteWindowTreeHostWin::HandleMetroExit() { |
| 265 if (!host_) | 250 if (!host_) |
| 266 return; | 251 return; |
| 267 host_->Send(new MetroViewerHostMsg_MetroExit()); | 252 host_->Send(new MetroViewerHostMsg_MetroExit()); |
| 268 } | 253 } |
| 269 | 254 |
| 270 void RemoteWindowTreeHostWin::HandleOpenFile( | 255 void RemoteWindowTreeHostWin::HandleOpenFile( |
| 271 const base::string16& title, | 256 const base::string16& title, |
| 272 const base::FilePath& default_path, | 257 const base::FilePath& default_path, |
| 273 const base::string16& filter, | 258 const base::string16& filter, |
| (...skipping 458 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 732 } | 717 } |
| 733 | 718 |
| 734 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { | 719 void RemoteWindowTreeHostWin::SetEventFlags(uint32 flags) { |
| 735 if (flags == event_flags_) | 720 if (flags == event_flags_) |
| 736 return; | 721 return; |
| 737 event_flags_ = flags; | 722 event_flags_ = flags; |
| 738 SetVirtualKeyStates(event_flags_); | 723 SetVirtualKeyStates(event_flags_); |
| 739 } | 724 } |
| 740 | 725 |
| 741 } // namespace aura | 726 } // namespace aura |
| OLD | NEW |