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. Notifies the metro viewer to shutdown |
| 97 // gracefully. |
| 98 AURA_EXPORT void HandleMetroExit(); |
| 99 |
97 // WindowTreeHost implementaton that receives events from a different | 100 // WindowTreeHost 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 RemoteWindowTreeHostWin | 103 class AURA_EXPORT RemoteWindowTreeHostWin |
101 : public WindowTreeHost, | 104 : public WindowTreeHost, |
102 public ui::internal::RemoteInputMethodDelegateWin { | 105 public ui::internal::RemoteInputMethodDelegateWin { |
103 public: | 106 public: |
104 // Returns the only RemoteWindowTreeHostWin, if this is the first time | 107 // Returns the only RemoteWindowTreeHostWin, 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 RemoteWindowTreeHostWin* Instance(); | 109 static RemoteWindowTreeHostWin* Instance(); |
107 static RemoteWindowTreeHostWin* Create(const gfx::Rect& bounds); | 110 static RemoteWindowTreeHostWin* 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 // Notify the metro viewer that it should shut itself down. |
| 130 void HandleMetroExit(); |
127 | 131 |
128 void HandleOpenFile(const base::string16& title, | 132 void HandleOpenFile(const base::string16& title, |
129 const base::FilePath& default_path, | 133 const base::FilePath& default_path, |
130 const base::string16& filter, | 134 const base::string16& filter, |
131 const OpenFileCompletion& on_success, | 135 const OpenFileCompletion& on_success, |
132 const FileSelectionCanceled& on_failure); | 136 const FileSelectionCanceled& on_failure); |
133 | 137 |
134 void HandleOpenMultipleFiles(const base::string16& title, | 138 void HandleOpenMultipleFiles(const base::string16& title, |
135 const base::FilePath& default_path, | 139 const base::FilePath& default_path, |
136 const base::string16& filter, | 140 const base::string16& filter, |
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
283 | 287 |
284 // Current size of this root window. | 288 // Current size of this root window. |
285 gfx::Size window_size_; | 289 gfx::Size window_size_; |
286 | 290 |
287 DISALLOW_COPY_AND_ASSIGN(RemoteWindowTreeHostWin); | 291 DISALLOW_COPY_AND_ASSIGN(RemoteWindowTreeHostWin); |
288 }; | 292 }; |
289 | 293 |
290 } // namespace aura | 294 } // namespace aura |
291 | 295 |
292 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ | 296 #endif // UI_AURA_REMOTE_ROOT_WINDOW_HOST_WIN_H_ |
OLD | NEW |