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 WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ | 5 #ifndef WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ |
6 #define WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ | 6 #define WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ |
7 | 7 |
| 8 #include <stdint.h> |
8 #include <windows.applicationmodel.core.h> | 9 #include <windows.applicationmodel.core.h> |
9 #include <windows.ui.core.h> | 10 #include <windows.ui.core.h> |
10 #include <windows.ui.input.h> | 11 #include <windows.ui.input.h> |
11 #include <windows.ui.viewmanagement.h> | 12 #include <windows.ui.viewmanagement.h> |
12 | 13 |
13 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop/message_loop.h" | 15 #include "base/message_loop/message_loop.h" |
15 #include "base/strings/string16.h" | 16 #include "base/strings/string16.h" |
16 #include "base/threading/thread.h" | 17 #include "base/threading/thread.h" |
17 #include "ipc/ipc_listener.h" | 18 #include "ipc/ipc_listener.h" |
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
101 | 102 |
102 // This function is invoked when the folder picker operation completes. The | 103 // This function is invoked when the folder picker operation completes. The |
103 // result of the operation is passed in along with the FolderPickerSession | 104 // result of the operation is passed in along with the FolderPickerSession |
104 // instance which is deleted after we read the required information from | 105 // instance which is deleted after we read the required information from |
105 // the FolderPickerSession class. | 106 // the FolderPickerSession class. |
106 void OnFolderPickerCompleted(FolderPickerSession* folder_picker, | 107 void OnFolderPickerCompleted(FolderPickerSession* folder_picker, |
107 bool success); | 108 bool success); |
108 | 109 |
109 void OnImeCancelComposition(); | 110 void OnImeCancelComposition(); |
110 void OnImeUpdateTextInputClient( | 111 void OnImeUpdateTextInputClient( |
111 const std::vector<int32>& input_scopes, | 112 const std::vector<int32_t>& input_scopes, |
112 const std::vector<metro_viewer::CharacterBounds>& character_bounds); | 113 const std::vector<metro_viewer::CharacterBounds>& character_bounds); |
113 | 114 |
114 void OnMetroExit(MetroTerminateMethod method); | 115 void OnMetroExit(MetroTerminateMethod method); |
115 | 116 |
116 HWND core_window_hwnd() const { return core_window_hwnd_; } | 117 HWND core_window_hwnd() const { return core_window_hwnd_; } |
117 | 118 |
118 | 119 |
119 private: | 120 private: |
120 class PointerInfoHandler; | 121 class PointerInfoHandler; |
121 | 122 |
122 // ImePopupObserver overrides. | 123 // ImePopupObserver overrides. |
123 void OnImePopupChanged(ImePopupObserver::EventType event) override; | 124 void OnImePopupChanged(ImePopupObserver::EventType event) override; |
124 | 125 |
125 // InputSourceObserver overrides. | 126 // InputSourceObserver overrides. |
126 void OnInputSourceChanged() override; | 127 void OnInputSourceChanged() override; |
127 | 128 |
128 // TextServiceDelegate overrides. | 129 // TextServiceDelegate overrides. |
129 void OnCompositionChanged( | 130 void OnCompositionChanged( |
130 const base::string16& text, | 131 const base::string16& text, |
131 int32 selection_start, | 132 int32_t selection_start, |
132 int32 selection_end, | 133 int32_t selection_end, |
133 const std::vector<metro_viewer::UnderlineInfo>& underlines) override; | 134 const std::vector<metro_viewer::UnderlineInfo>& underlines) override; |
134 void OnTextCommitted(const base::string16& text) override; | 135 void OnTextCommitted(const base::string16& text) override; |
135 | 136 |
136 // Convenience for sending a MetroViewerHostMsg_MouseButton with the specified | 137 // Convenience for sending a MetroViewerHostMsg_MouseButton with the specified |
137 // parameters. | 138 // parameters. |
138 void SendMouseButton(int x, | 139 void SendMouseButton(int x, |
139 int y, | 140 int y, |
140 int extra, | 141 int extra, |
141 ui::EventType event_type, | 142 ui::EventType event_type, |
142 uint32 flags, | 143 uint32_t flags, |
143 ui::EventFlags changed_button, | 144 ui::EventFlags changed_button, |
144 bool is_horizontal_wheel); | 145 bool is_horizontal_wheel); |
145 | 146 |
146 // Win8 only generates a mouse press for the initial button that goes down and | 147 // Win8 only generates a mouse press for the initial button that goes down and |
147 // a release when the last button is released. Any intermediary presses (or | 148 // a release when the last button is released. Any intermediary presses (or |
148 // releases) do not result in a new press/release event. Instead a move is | 149 // releases) do not result in a new press/release event. Instead a move is |
149 // generated with the winui::Input::PointerUpdateKind identifying what | 150 // generated with the winui::Input::PointerUpdateKind identifying what |
150 // changed. This function generates the necessary intermediary events (as | 151 // changed. This function generates the necessary intermediary events (as |
151 // necessary). | 152 // necessary). |
152 void GenerateMouseEventFromMoveIfNecessary(const PointerInfoHandler& pointer); | 153 void GenerateMouseEventFromMoveIfNecessary(const PointerInfoHandler& pointer); |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
216 EventRegistrationToken character_received_token_; | 217 EventRegistrationToken character_received_token_; |
217 EventRegistrationToken accel_keydown_token_; | 218 EventRegistrationToken accel_keydown_token_; |
218 EventRegistrationToken accel_keyup_token_; | 219 EventRegistrationToken accel_keyup_token_; |
219 EventRegistrationToken window_activated_token_; | 220 EventRegistrationToken window_activated_token_; |
220 EventRegistrationToken sizechange_token_; | 221 EventRegistrationToken sizechange_token_; |
221 EventRegistrationToken edgeevent_token_; | 222 EventRegistrationToken edgeevent_token_; |
222 | 223 |
223 // Keep state about which button is currently down, if any, as PointerMoved | 224 // Keep state about which button is currently down, if any, as PointerMoved |
224 // events do not contain that state, but Ash's MouseEvents need it. Value is | 225 // events do not contain that state, but Ash's MouseEvents need it. Value is |
225 // as a bitmask of ui::EventFlags. | 226 // as a bitmask of ui::EventFlags. |
226 uint32 mouse_down_flags_; | 227 uint32_t mouse_down_flags_; |
227 | 228 |
228 // Set the D3D swap chain and nothing else. | 229 // Set the D3D swap chain and nothing else. |
229 metro_driver::Direct3DHelper direct3d_helper_; | 230 metro_driver::Direct3DHelper direct3d_helper_; |
230 | 231 |
231 // The IPC channel IO thread. | 232 // The IPC channel IO thread. |
232 scoped_ptr<base::Thread> io_thread_; | 233 scoped_ptr<base::Thread> io_thread_; |
233 | 234 |
234 // The channel to Chrome, in particular to the MetroViewerProcessHost. | 235 // The channel to Chrome, in particular to the MetroViewerProcessHost. |
235 scoped_ptr<IPC::ChannelProxy> ui_channel_; | 236 scoped_ptr<IPC::ChannelProxy> ui_channel_; |
236 | 237 |
(...skipping 15 matching lines...) Expand all Loading... |
252 | 253 |
253 // The cursor set by the chroem browser process. | 254 // The cursor set by the chroem browser process. |
254 HCURSOR last_cursor_; | 255 HCURSOR last_cursor_; |
255 | 256 |
256 // Pointer to the channel listener for the channel between the viewer and | 257 // Pointer to the channel listener for the channel between the viewer and |
257 // the browser. | 258 // the browser. |
258 IPC::Listener* channel_listener_; | 259 IPC::Listener* channel_listener_; |
259 }; | 260 }; |
260 | 261 |
261 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ | 262 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ |
OLD | NEW |