Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: win8/metro_driver/chrome_app_view_ash.h

Issue 593353003: The metro_driver should not block the UI thread while waiting for the Chrome browser IPC channel to… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed unused timer id constant Created 6 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | win8/metro_driver/chrome_app_view_ash.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 "base/threading/thread.h"
17 #include "ipc/ipc_listener.h"
16 #include "ui/events/event_constants.h" 18 #include "ui/events/event_constants.h"
17 #include "win8/metro_driver/direct3d_helper.h" 19 #include "win8/metro_driver/direct3d_helper.h"
18 #include "win8/metro_driver/ime/ime_popup_observer.h" 20 #include "win8/metro_driver/ime/ime_popup_observer.h"
19 #include "win8/metro_driver/ime/input_source_observer.h" 21 #include "win8/metro_driver/ime/input_source_observer.h"
20 #include "win8/metro_driver/ime/text_service_delegate.h" 22 #include "win8/metro_driver/ime/text_service_delegate.h"
21 23
22 namespace base { 24 namespace base {
23 class FilePath; 25 class FilePath;
24 } 26 }
25 27
(...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 winui::Input::IEdgeGestureEventArgs* args); 191 winui::Input::IEdgeGestureEventArgs* args);
190 192
191 // Tasks posted to the UI thread to initiate the search/url navigation 193 // Tasks posted to the UI thread to initiate the search/url navigation
192 // requests. 194 // requests.
193 void OnSearchRequest(const base::string16& search_string); 195 void OnSearchRequest(const base::string16& search_string);
194 void OnNavigateToUrl(const base::string16& url); 196 void OnNavigateToUrl(const base::string16& url);
195 197
196 HRESULT OnSizeChanged(winui::Core::ICoreWindow* sender, 198 HRESULT OnSizeChanged(winui::Core::ICoreWindow* sender,
197 winui::Core::IWindowSizeChangedEventArgs* args); 199 winui::Core::IWindowSizeChangedEventArgs* args);
198 200
201 // This function checks if the Chrome browser channel is initialized. If yes
202 // then it goes ahead and starts up the viewer in Chrome OS mode. If not it
203 // posts a delayed task and checks again. It does this for a duration of 10
204 // seconds and then bails.
205 void StartChromeOSMode();
206
199 mswr::ComPtr<winui::Core::ICoreWindow> window_; 207 mswr::ComPtr<winui::Core::ICoreWindow> window_;
200 mswr::ComPtr<winapp::Core::ICoreApplicationView> view_; 208 mswr::ComPtr<winapp::Core::ICoreApplicationView> view_;
201 EventRegistrationToken activated_token_; 209 EventRegistrationToken activated_token_;
202 EventRegistrationToken pointermoved_token_; 210 EventRegistrationToken pointermoved_token_;
203 EventRegistrationToken pointerpressed_token_; 211 EventRegistrationToken pointerpressed_token_;
204 EventRegistrationToken pointerreleased_token_; 212 EventRegistrationToken pointerreleased_token_;
205 EventRegistrationToken wheel_token_; 213 EventRegistrationToken wheel_token_;
206 EventRegistrationToken keydown_token_; 214 EventRegistrationToken keydown_token_;
207 EventRegistrationToken keyup_token_; 215 EventRegistrationToken keyup_token_;
208 EventRegistrationToken character_received_token_; 216 EventRegistrationToken character_received_token_;
209 EventRegistrationToken accel_keydown_token_; 217 EventRegistrationToken accel_keydown_token_;
210 EventRegistrationToken accel_keyup_token_; 218 EventRegistrationToken accel_keyup_token_;
211 EventRegistrationToken window_activated_token_; 219 EventRegistrationToken window_activated_token_;
212 EventRegistrationToken sizechange_token_; 220 EventRegistrationToken sizechange_token_;
213 EventRegistrationToken edgeevent_token_; 221 EventRegistrationToken edgeevent_token_;
214 222
215 // Keep state about which button is currently down, if any, as PointerMoved 223 // Keep state about which button is currently down, if any, as PointerMoved
216 // events do not contain that state, but Ash's MouseEvents need it. Value is 224 // events do not contain that state, but Ash's MouseEvents need it. Value is
217 // as a bitmask of ui::EventFlags. 225 // as a bitmask of ui::EventFlags.
218 uint32 mouse_down_flags_; 226 uint32 mouse_down_flags_;
219 227
220 // Set the D3D swap chain and nothing else. 228 // Set the D3D swap chain and nothing else.
221 metro_driver::Direct3DHelper direct3d_helper_; 229 metro_driver::Direct3DHelper direct3d_helper_;
222 230
231 // The IPC channel IO thread.
232 scoped_ptr<base::Thread> io_thread_;
233
223 // The channel to Chrome, in particular to the MetroViewerProcessHost. 234 // The channel to Chrome, in particular to the MetroViewerProcessHost.
224 IPC::ChannelProxy* ui_channel_; 235 scoped_ptr<IPC::ChannelProxy> ui_channel_;
225 236
226 // The actual window behind the view surface. 237 // The actual window behind the view surface.
227 HWND core_window_hwnd_; 238 HWND core_window_hwnd_;
228 239
229 // UI message loop to allow message passing into this thread. 240 // UI message loop to allow message passing into this thread.
230 base::MessageLoopForUI ui_loop_; 241 base::MessageLoopForUI ui_loop_;
231 242
232 // For IME support. 243 // For IME support.
233 scoped_ptr<metro_driver::InputSource> input_source_; 244 scoped_ptr<metro_driver::InputSource> input_source_;
234 scoped_ptr<metro_driver::TextService> text_service_; 245 scoped_ptr<metro_driver::TextService> text_service_;
235 246
236 // The metro device scale factor as reported by the winrt interfaces. 247 // The metro device scale factor as reported by the winrt interfaces.
237 float metro_dpi_scale_; 248 float metro_dpi_scale_;
238 // The win32 dpi scale which is queried via GetDeviceCaps. Please refer to 249 // The win32 dpi scale which is queried via GetDeviceCaps. Please refer to
239 // ui/gfx/win/dpi.cc for more information. 250 // ui/gfx/win/dpi.cc for more information.
240 float win32_dpi_scale_; 251 float win32_dpi_scale_;
241 252
242 // The cursor set by the chroem browser process. 253 // The cursor set by the chroem browser process.
243 HCURSOR last_cursor_; 254 HCURSOR last_cursor_;
255
256 // Pointer to the channel listener for the channel between the viewer and
257 // the browser.
258 IPC::Listener* channel_listener_;
244 }; 259 };
245 260
246 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ 261 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_
OLDNEW
« no previous file with comments | « no previous file | win8/metro_driver/chrome_app_view_ash.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698