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 <windows.applicationmodel.core.h> | 8 #include <windows.applicationmodel.core.h> |
9 #include <windows.ui.core.h> | 9 #include <windows.ui.core.h> |
10 #include <windows.ui.input.h> | 10 #include <windows.ui.input.h> |
11 #include <windows.ui.viewmanagement.h> | 11 #include <windows.ui.viewmanagement.h> |
12 | 12 |
13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
14 #include "base/message_loop/message_loop.h" | 14 #include "base/message_loop/message_loop.h" |
15 #include "base/strings/string16.h" | 15 #include "base/strings/string16.h" |
16 #include "ui/events/event_constants.h" | 16 #include "ui/events/event_constants.h" |
17 #include "win8/metro_driver/direct3d_helper.h" | 17 #include "win8/metro_driver/direct3d_helper.h" |
| 18 #include "win8/metro_driver/ime/text_service_delegate.h" |
18 | 19 |
19 namespace base { | 20 namespace base { |
20 class FilePath; | 21 class FilePath; |
21 } | 22 } |
22 | 23 |
23 namespace IPC { | 24 namespace IPC { |
24 class Listener; | 25 class Listener; |
25 class ChannelProxy; | 26 class ChannelProxy; |
26 } | 27 } |
27 | 28 |
| 29 namespace metro_driver { |
| 30 class TextService; |
| 31 } |
| 32 |
| 33 namespace metro_viewer { |
| 34 struct CharacterBounds; |
| 35 struct UnderlineInfo; |
| 36 } |
| 37 |
28 class OpenFilePickerSession; | 38 class OpenFilePickerSession; |
29 class SaveFilePickerSession; | 39 class SaveFilePickerSession; |
30 class FolderPickerSession; | 40 class FolderPickerSession; |
31 class FilePickerSessionBase; | 41 class FilePickerSessionBase; |
32 | 42 |
33 struct MetroViewerHostMsg_SaveAsDialogParams; | 43 struct MetroViewerHostMsg_SaveAsDialogParams; |
34 | 44 |
35 class ChromeAppViewAsh | 45 class ChromeAppViewAsh |
36 : public mswr::RuntimeClass<winapp::Core::IFrameworkView> { | 46 : public mswr::RuntimeClass<winapp::Core::IFrameworkView>, |
| 47 public metro_driver::TextServiceDelegate { |
37 public: | 48 public: |
38 ChromeAppViewAsh(); | 49 ChromeAppViewAsh(); |
39 ~ChromeAppViewAsh(); | 50 ~ChromeAppViewAsh(); |
40 | 51 |
41 // IViewProvider overrides. | 52 // IViewProvider overrides. |
42 IFACEMETHOD(Initialize)(winapp::Core::ICoreApplicationView* view); | 53 IFACEMETHOD(Initialize)(winapp::Core::ICoreApplicationView* view); |
43 IFACEMETHOD(SetWindow)(winui::Core::ICoreWindow* window); | 54 IFACEMETHOD(SetWindow)(winui::Core::ICoreWindow* window); |
44 IFACEMETHOD(Load)(HSTRING entryPoint); | 55 IFACEMETHOD(Load)(HSTRING entryPoint); |
45 IFACEMETHOD(Run)(); | 56 IFACEMETHOD(Run)(); |
46 IFACEMETHOD(Uninitialize)(); | 57 IFACEMETHOD(Uninitialize)(); |
(...skipping 28 matching lines...) Expand all Loading... |
75 void OnSaveFileCompleted(SaveFilePickerSession* save_file_picker, | 86 void OnSaveFileCompleted(SaveFilePickerSession* save_file_picker, |
76 bool success); | 87 bool success); |
77 | 88 |
78 // This function is invoked when the folder picker operation completes. The | 89 // This function is invoked when the folder picker operation completes. The |
79 // result of the operation is passed in along with the FolderPickerSession | 90 // result of the operation is passed in along with the FolderPickerSession |
80 // instance which is deleted after we read the required information from | 91 // instance which is deleted after we read the required information from |
81 // the FolderPickerSession class. | 92 // the FolderPickerSession class. |
82 void OnFolderPickerCompleted(FolderPickerSession* folder_picker, | 93 void OnFolderPickerCompleted(FolderPickerSession* folder_picker, |
83 bool success); | 94 bool success); |
84 | 95 |
| 96 void OnImeCancelComposition(); |
| 97 void OnImeUpdateTextInputClient( |
| 98 const std::vector<int32>& input_scopes, |
| 99 const std::vector<metro_viewer::CharacterBounds>& character_bounds); |
| 100 |
85 HWND core_window_hwnd() const { return core_window_hwnd_; } | 101 HWND core_window_hwnd() const { return core_window_hwnd_; } |
86 | 102 |
| 103 |
87 private: | 104 private: |
| 105 // TextServiceDelegate overrides. |
| 106 virtual void OnCompositionChanged( |
| 107 const string16& text, |
| 108 int32 selection_start, |
| 109 int32 selection_end, |
| 110 const std::vector<metro_viewer::UnderlineInfo>& underlines) OVERRIDE; |
| 111 virtual void OnTextCommitted(const string16& text) OVERRIDE; |
| 112 |
88 HRESULT OnActivate(winapp::Core::ICoreApplicationView* view, | 113 HRESULT OnActivate(winapp::Core::ICoreApplicationView* view, |
89 winapp::Activation::IActivatedEventArgs* args); | 114 winapp::Activation::IActivatedEventArgs* args); |
90 | 115 |
91 HRESULT OnPointerMoved(winui::Core::ICoreWindow* sender, | 116 HRESULT OnPointerMoved(winui::Core::ICoreWindow* sender, |
92 winui::Core::IPointerEventArgs* args); | 117 winui::Core::IPointerEventArgs* args); |
93 | 118 |
94 HRESULT OnPointerPressed(winui::Core::ICoreWindow* sender, | 119 HRESULT OnPointerPressed(winui::Core::ICoreWindow* sender, |
95 winui::Core::IPointerEventArgs* args); | 120 winui::Core::IPointerEventArgs* args); |
96 | 121 |
97 HRESULT OnPointerReleased(winui::Core::ICoreWindow* sender, | 122 HRESULT OnPointerReleased(winui::Core::ICoreWindow* sender, |
(...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
156 metro_driver::Direct3DHelper direct3d_helper_; | 181 metro_driver::Direct3DHelper direct3d_helper_; |
157 | 182 |
158 // The channel to Chrome, in particular to the MetroViewerProcessHost. | 183 // The channel to Chrome, in particular to the MetroViewerProcessHost. |
159 IPC::ChannelProxy* ui_channel_; | 184 IPC::ChannelProxy* ui_channel_; |
160 | 185 |
161 // The actual window behind the view surface. | 186 // The actual window behind the view surface. |
162 HWND core_window_hwnd_; | 187 HWND core_window_hwnd_; |
163 | 188 |
164 // UI message loop to allow message passing into this thread. | 189 // UI message loop to allow message passing into this thread. |
165 base::MessageLoop ui_loop_; | 190 base::MessageLoop ui_loop_; |
| 191 |
| 192 // For IME support. |
| 193 scoped_ptr<metro_driver::TextService> text_service_; |
166 }; | 194 }; |
167 | 195 |
168 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ | 196 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ |
OLD | NEW |