Chromium Code Reviews| 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 #ifndef UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 5 #ifndef UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
| 6 #define UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 6 #define UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
| 7 | 7 |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/callback.h" | 10 #include "base/callback.h" |
| (...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 79 const SaveFileCompletion& on_success, | 79 const SaveFileCompletion& on_success, |
| 80 const FileSelectionCanceled& on_failure); | 80 const FileSelectionCanceled& on_failure); |
| 81 | 81 |
| 82 // Handles the select folder for Metro Chrome Ash. The on_success | 82 // Handles the select folder for Metro Chrome Ash. The on_success |
| 83 // callback passed in is invoked when we receive the folder name from the | 83 // callback passed in is invoked when we receive the folder name from the |
| 84 // metro viewer. The on failure callback is invoked on failure. | 84 // metro viewer. The on failure callback is invoked on failure. |
| 85 AURA_EXPORT void HandleSelectFolder(const base::string16& title, | 85 AURA_EXPORT void HandleSelectFolder(const base::string16& title, |
| 86 const SelectFolderCompletion& on_success, | 86 const SelectFolderCompletion& on_success, |
| 87 const FileSelectionCanceled& on_failure); | 87 const FileSelectionCanceled& on_failure); |
| 88 | 88 |
| 89 // Handles the activate desktop command for Metro Chrome Ash. The on_success | 89 // Handles the activate desktop command for Metro Chrome Ash. The |ash_exit| |
| 90 // callback passed in is invoked when activation is completed. | 90 // parameter indicates whether the Ash process would be shutdown after |
| 91 // The |ash_exit| parameter indicates whether the Ash process would be shutdown | 91 // activating the desktop. |
| 92 // after activating the desktop. | |
| 93 AURA_EXPORT void HandleActivateDesktop( | 92 AURA_EXPORT void HandleActivateDesktop( |
| 94 const base::FilePath& shortcut, | 93 const base::FilePath& shortcut, |
| 95 bool ash_exit); | 94 bool ash_exit); |
| 96 | 95 |
| 96 // Handles the metro exit command. Causes the metro viewer to close itself | |
| 97 // gracefully. | |
| 98 AURA_EXPORT void HandleMetroExit(); | |
|
sky
2014/01/09 16:40:05
Why do we need this instead of having callers do a
zturner
2014/01/10 19:00:26
I believe it's because on component builds we have
| |
| 99 | |
| 97 // RootWindowHost implementaton that receives events from a different | 100 // RootWindowHost implementaton that receives events from a different |
| 98 // process. In the case of Windows this is the Windows 8 (aka Metro) | 101 // process. In the case of Windows this is the Windows 8 (aka Metro) |
| 99 // frontend process, which forwards input events to this class. | 102 // frontend process, which forwards input events to this class. |
| 100 class AURA_EXPORT RemoteRootWindowHostWin | 103 class AURA_EXPORT RemoteRootWindowHostWin |
| 101 : public RootWindowHost, | 104 : public RootWindowHost, |
| 102 public ui::internal::RemoteInputMethodDelegateWin { | 105 public ui::internal::RemoteInputMethodDelegateWin { |
| 103 public: | 106 public: |
| 104 // Returns the only RemoteRootWindowHostWin, if this is the first time | 107 // Returns the only RemoteRootWindowHostWin, if this is the first time |
| 105 // this function is called, it will call Create() wiht empty bounds. | 108 // this function is called, it will call Create() wiht empty bounds. |
| 106 static RemoteRootWindowHostWin* Instance(); | 109 static RemoteRootWindowHostWin* Instance(); |
| 107 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); | 110 static RemoteRootWindowHostWin* Create(const gfx::Rect& bounds); |
| 108 | 111 |
| 109 // Called when the remote process has established its IPC connection. | 112 // Called when the remote process has established its IPC connection. |
| 110 // The |host| can be used when we need to send a message to it and | 113 // The |host| can be used when we need to send a message to it and |
| 111 // |remote_window| is the actual window owned by the viewer process. | 114 // |remote_window| is the actual window owned by the viewer process. |
| 112 void Connected(IPC::Sender* host, HWND remote_window); | 115 void Connected(IPC::Sender* host, HWND remote_window); |
| 113 // Called when the remote process has closed its IPC connection. | 116 // Called when the remote process has closed its IPC connection. |
| 114 void Disconnected(); | 117 void Disconnected(); |
| 115 | 118 |
| 116 // Called when we have a message from the remote process. | 119 // Called when we have a message from the remote process. |
| 117 bool OnMessageReceived(const IPC::Message& message); | 120 bool OnMessageReceived(const IPC::Message& message); |
| 118 | 121 |
| 119 void HandleOpenURLOnDesktop(const base::FilePath& shortcut, | 122 void HandleOpenURLOnDesktop(const base::FilePath& shortcut, |
| 120 const base::string16& url); | 123 const base::string16& url); |
| 121 | 124 |
| 122 // The |ash_exit| parameter indicates whether the Ash process would be | 125 // The |ash_exit| parameter indicates whether the Ash process would be |
| 123 // shutdown after activating the desktop. | 126 // shutdown after activating the desktop. |
| 124 void HandleActivateDesktop( | 127 void HandleActivateDesktop(const base::FilePath& shortcut, bool ash_exit); |
| 125 const base::FilePath& shortcut, | 128 |
| 126 bool ash_exit); | 129 void HandleMetroExit(); |
| 127 | 130 |
| 128 void HandleOpenFile(const base::string16& title, | 131 void HandleOpenFile(const base::string16& title, |
| 129 const base::FilePath& default_path, | 132 const base::FilePath& default_path, |
| 130 const base::string16& filter, | 133 const base::string16& filter, |
| 131 const OpenFileCompletion& on_success, | 134 const OpenFileCompletion& on_success, |
| 132 const FileSelectionCanceled& on_failure); | 135 const FileSelectionCanceled& on_failure); |
| 133 | 136 |
| 134 void HandleOpenMultipleFiles(const base::string16& title, | 137 void HandleOpenMultipleFiles(const base::string16& title, |
| 135 const base::FilePath& default_path, | 138 const base::FilePath& default_path, |
| 136 const base::string16& filter, | 139 const base::string16& filter, |
| (...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 283 | 286 |
| 284 // Current size of this root window. | 287 // Current size of this root window. |
| 285 gfx::Size window_size_; | 288 gfx::Size window_size_; |
| 286 | 289 |
| 287 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); | 290 DISALLOW_COPY_AND_ASSIGN(RemoteRootWindowHostWin); |
| 288 }; | 291 }; |
| 289 | 292 |
| 290 } // namespace aura | 293 } // namespace aura |
| 291 | 294 |
| 292 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 295 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
| OLD | NEW |