Wed, 31 Dec 2014 06:09:35 +0100
Cloned upstream origin tor-browser at tor-browser-31.3.0esr-4.5-1-build1
revision ID fc1c9ff7c1b2defdbc039f12214767608f46423f for hacking purpose.
michael@0 | 1 | /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ |
michael@0 | 2 | /* This Source Code Form is subject to the terms of the Mozilla Public |
michael@0 | 3 | * License, v. 2.0. If a copy of the MPL was not distributed with this |
michael@0 | 4 | * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ |
michael@0 | 5 | |
michael@0 | 6 | #pragma once |
michael@0 | 7 | |
michael@0 | 8 | #include "mozwrlbase.h" |
michael@0 | 9 | |
michael@0 | 10 | #include <windows.system.h> |
michael@0 | 11 | #include <windows.ui.core.h> |
michael@0 | 12 | #include <Windows.ApplicationModel.core.h> |
michael@0 | 13 | #include <Windows.ApplicationModel.h> |
michael@0 | 14 | #include <Windows.Applicationmodel.Activation.h> |
michael@0 | 15 | |
michael@0 | 16 | class MetroWidget; |
michael@0 | 17 | |
michael@0 | 18 | namespace mozilla { |
michael@0 | 19 | namespace widget { |
michael@0 | 20 | namespace winrt { |
michael@0 | 21 | |
michael@0 | 22 | class MetroApp : public Microsoft::WRL::RuntimeClass<ABI::Windows::ApplicationModel::Core::IFrameworkViewSource> |
michael@0 | 23 | { |
michael@0 | 24 | InspectableClass(L"MetroApp", TrustLevel::BaseTrust) |
michael@0 | 25 | |
michael@0 | 26 | typedef ABI::Windows::UI::Core::CoreDispatcherPriority CoreDispatcherPriority; |
michael@0 | 27 | typedef ABI::Windows::ApplicationModel::Activation::LaunchActivatedEventArgs LaunchActivatedEventArgs; |
michael@0 | 28 | typedef ABI::Windows::ApplicationModel::ISuspendingEventArgs ISuspendingEventArgs; |
michael@0 | 29 | typedef ABI::Windows::ApplicationModel::Core::IFrameworkView IFrameworkView; |
michael@0 | 30 | typedef ABI::Windows::ApplicationModel::Core::ICoreApplication ICoreApplication; |
michael@0 | 31 | |
michael@0 | 32 | public: |
michael@0 | 33 | // IFrameworkViewSource |
michael@0 | 34 | STDMETHODIMP CreateView(IFrameworkView **viewProvider); |
michael@0 | 35 | |
michael@0 | 36 | // ICoreApplication event |
michael@0 | 37 | HRESULT OnSuspending(IInspectable* aSender, ISuspendingEventArgs* aArgs); |
michael@0 | 38 | HRESULT OnResuming(IInspectable* aSender, IInspectable* aArgs); |
michael@0 | 39 | |
michael@0 | 40 | // nsIWinMetroUtils tile related async callbacks |
michael@0 | 41 | HRESULT OnAsyncTileCreated(ABI::Windows::Foundation::IAsyncOperation<bool>* aOperation, AsyncStatus aStatus); |
michael@0 | 42 | |
michael@0 | 43 | void Run(); |
michael@0 | 44 | void CoreExit(); |
michael@0 | 45 | void Shutdown(); |
michael@0 | 46 | void ActivateBaseView(); |
michael@0 | 47 | |
michael@0 | 48 | // Set when gecko enters xpcom shutdown. |
michael@0 | 49 | static bool sGeckoShuttingDown; |
michael@0 | 50 | |
michael@0 | 51 | // Shared pointers between framework and widget |
michael@0 | 52 | void SetWidget(MetroWidget* aPtr); |
michael@0 | 53 | |
michael@0 | 54 | static void PostSuspendResumeProcessNotification(bool aIsSuspend); |
michael@0 | 55 | static void PostSleepWakeNotification(bool aIsSuspend); |
michael@0 | 56 | |
michael@0 | 57 | private: |
michael@0 | 58 | EventRegistrationToken mSuspendEvent; |
michael@0 | 59 | EventRegistrationToken mResumeEvent; |
michael@0 | 60 | }; |
michael@0 | 61 | |
michael@0 | 62 | } } } |