diff options
author | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 17:42:32 +0000 |
---|---|---|
committer | cpu@chromium.org <cpu@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2012-10-24 17:42:32 +0000 |
commit | 7c3b7003d5f513a2608ec6586901d6367a21b0e6 (patch) | |
tree | c50d5350c229404c9e6484e5ac04b5ac44a8544c /win8/metro_driver/chrome_app_view_ash.h | |
parent | 3c17ae74d8ead9a9117c7837f832da0d02a225fa (diff) | |
download | chromium_src-7c3b7003d5f513a2608ec6586901d6367a21b0e6.zip chromium_src-7c3b7003d5f513a2608ec6586901d6367a21b0e6.tar.gz chromium_src-7c3b7003d5f513a2608ec6586901d6367a21b0e6.tar.bz2 |
Split ash and non-ash metro driver code
ChromeAppViewFactory now produces ChromeAppView or ChromeAppViewAsh depending on the use_aura gyp flag.
The two versions have very little in common. Overt time they might share more code.
BUG=151718
TEST=see bug
Review URL: https://codereview.chromium.org/11233070
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@163860 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'win8/metro_driver/chrome_app_view_ash.h')
-rw-r--r-- | win8/metro_driver/chrome_app_view_ash.h | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/win8/metro_driver/chrome_app_view_ash.h b/win8/metro_driver/chrome_app_view_ash.h new file mode 100644 index 0000000..2379b51 --- /dev/null +++ b/win8/metro_driver/chrome_app_view_ash.h @@ -0,0 +1,69 @@ +// Copyright (c) 2012 The Chromium Authors. All rights reserved. +// Use of this source code is governed by a BSD-style license that can be +// found in the LICENSE file. + +#ifndef WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ +#define WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ + +#include <windows.applicationmodel.core.h> +#include <windows.ui.core.h> +#include <windows.ui.input.h> +#include <windows.ui.viewmanagement.h> + +#include "base/memory/scoped_ptr.h" +#include "win8/metro_driver/direct3d_helper.h" + +namespace IPC { + class Listener; + class ChannelProxy; +} + +class ChromeAppViewAsh + : public mswr::RuntimeClass<winapp::Core::IFrameworkView> { + public: + ChromeAppViewAsh(); + ~ChromeAppViewAsh(); + + // IViewProvider overrides. + IFACEMETHOD(Initialize)(winapp::Core::ICoreApplicationView* view); + IFACEMETHOD(SetWindow)(winui::Core::ICoreWindow* window); + IFACEMETHOD(Load)(HSTRING entryPoint); + IFACEMETHOD(Run)(); + IFACEMETHOD(Uninitialize)(); + + private: + HRESULT OnActivate(winapp::Core::ICoreApplicationView* view, + winapp::Activation::IActivatedEventArgs* args); + + HRESULT OnPointerMoved(winui::Core::ICoreWindow* sender, + winui::Core::IPointerEventArgs* args); + + HRESULT OnPointerPressed(winui::Core::ICoreWindow* sender, + winui::Core::IPointerEventArgs* args); + + HRESULT OnPointerReleased(winui::Core::ICoreWindow* sender, + winui::Core::IPointerEventArgs* args); + + HRESULT OnKeyDown(winui::Core::ICoreWindow* sender, + winui::Core::IKeyEventArgs* args); + + HRESULT OnKeyUp(winui::Core::ICoreWindow* sender, + winui::Core::IKeyEventArgs* args); + + + mswr::ComPtr<winui::Core::ICoreWindow> window_; + mswr::ComPtr<winapp::Core::ICoreApplicationView> view_; + EventRegistrationToken activated_token_; + EventRegistrationToken pointermoved_token_; + EventRegistrationToken pointerpressed_token_; + EventRegistrationToken pointerreleased_token_; + EventRegistrationToken keydown_token_; + EventRegistrationToken keyup_token_; + + metro_driver::Direct3DHelper direct3d_helper_; + + IPC::Listener* ui_channel_listener_; + IPC::ChannelProxy* ui_channel_; +}; + +#endif // WIN8_METRO_DRIVER_CHROME_APP_VIEW_ASH_H_ |