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

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: Code review comments 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
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 waits for the Chrome browser channel to be initialized.
202 // It then goes ahead and starts up the viewer in Chrome OS mode.
203 static void CALLBACK StartChromeOSMode(HWND core_window,
204 UINT message,
205 UINT_PTR timer_id,
206 DWORD time);
207
199 mswr::ComPtr<winui::Core::ICoreWindow> window_; 208 mswr::ComPtr<winui::Core::ICoreWindow> window_;
200 mswr::ComPtr<winapp::Core::ICoreApplicationView> view_; 209 mswr::ComPtr<winapp::Core::ICoreApplicationView> view_;
201 EventRegistrationToken activated_token_; 210 EventRegistrationToken activated_token_;
202 EventRegistrationToken pointermoved_token_; 211 EventRegistrationToken pointermoved_token_;
203 EventRegistrationToken pointerpressed_token_; 212 EventRegistrationToken pointerpressed_token_;
204 EventRegistrationToken pointerreleased_token_; 213 EventRegistrationToken pointerreleased_token_;
205 EventRegistrationToken wheel_token_; 214 EventRegistrationToken wheel_token_;
206 EventRegistrationToken keydown_token_; 215 EventRegistrationToken keydown_token_;
207 EventRegistrationToken keyup_token_; 216 EventRegistrationToken keyup_token_;
208 EventRegistrationToken character_received_token_; 217 EventRegistrationToken character_received_token_;
209 EventRegistrationToken accel_keydown_token_; 218 EventRegistrationToken accel_keydown_token_;
210 EventRegistrationToken accel_keyup_token_; 219 EventRegistrationToken accel_keyup_token_;
211 EventRegistrationToken window_activated_token_; 220 EventRegistrationToken window_activated_token_;
212 EventRegistrationToken sizechange_token_; 221 EventRegistrationToken sizechange_token_;
213 EventRegistrationToken edgeevent_token_; 222 EventRegistrationToken edgeevent_token_;
214 223
215 // 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
216 // 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
217 // as a bitmask of ui::EventFlags. 226 // as a bitmask of ui::EventFlags.
218 uint32 mouse_down_flags_; 227 uint32 mouse_down_flags_;
219 228
220 // Set the D3D swap chain and nothing else. 229 // Set the D3D swap chain and nothing else.
221 metro_driver::Direct3DHelper direct3d_helper_; 230 metro_driver::Direct3DHelper direct3d_helper_;
222 231
232 // The IPC channel IO thread.
233 scoped_ptr<base::Thread> io_thread_;
234
223 // The channel to Chrome, in particular to the MetroViewerProcessHost. 235 // The channel to Chrome, in particular to the MetroViewerProcessHost.
224 IPC::ChannelProxy* ui_channel_; 236 scoped_ptr<IPC::ChannelProxy> ui_channel_;
225 237
226 // The actual window behind the view surface. 238 // The actual window behind the view surface.
227 HWND core_window_hwnd_; 239 HWND core_window_hwnd_;
228 240
229 // UI message loop to allow message passing into this thread. 241 // UI message loop to allow message passing into this thread.
230 base::MessageLoopForUI ui_loop_; 242 base::MessageLoopForUI ui_loop_;
231 243
232 // For IME support. 244 // For IME support.
233 scoped_ptr<metro_driver::InputSource> input_source_; 245 scoped_ptr<metro_driver::InputSource> input_source_;
234 scoped_ptr<metro_driver::TextService> text_service_; 246 scoped_ptr<metro_driver::TextService> text_service_;
235 247
236 // The metro device scale factor as reported by the winrt interfaces. 248 // The metro device scale factor as reported by the winrt interfaces.
237 float metro_dpi_scale_; 249 float metro_dpi_scale_;
238 // The win32 dpi scale which is queried via GetDeviceCaps. Please refer to 250 // The win32 dpi scale which is queried via GetDeviceCaps. Please refer to
239 // ui/gfx/win/dpi.cc for more information. 251 // ui/gfx/win/dpi.cc for more information.
240 float win32_dpi_scale_; 252 float win32_dpi_scale_;
241 253
242 // The cursor set by the chroem browser process. 254 // The cursor set by the chroem browser process.
243 HCURSOR last_cursor_; 255 HCURSOR last_cursor_;
256
257 // The pointer to the ChromeAppViewAsh instance. There should only be one
258 // instance of the ChromeAppViewAsh class.
259 static ChromeAppViewAsh* g_instance_;
260
261 // Pointer to the channel listener for the channel between the viewer and
262 // the browser.
263 IPC::Listener* channel_listener_;
244 }; 264 };
245 265
246 #endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ 266 #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') | win8/metro_driver/chrome_app_view_ash.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698