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
3 // found in the LICENSE file.
5 #ifndef BASE_WIN_METRO_H_
6 #define BASE_WIN_METRO_H_
11 #include "base/base_export.h"
12 #include "base/string16.h"
17 // Identifies the type of the metro launch.
18 enum MetroLaunchType
{
28 // In metro mode, this enum identifies the last execution state, i.e. whether
29 // we crashed, terminated, etc.
30 enum MetroPreviousExecutionState
{
39 // Contains information about the currently displayed tab in metro mode.
40 struct CurrentTabInfo
{
45 // Returns the handle to the metro dll loaded in the process. A NULL return
46 // indicates that the metro dll was not loaded in the process.
47 BASE_EXPORT HMODULE
GetMetroModule();
49 // Returns true if this process is running as an immersive program
50 // in Windows Metro mode.
51 BASE_EXPORT
bool IsMetroProcess();
53 // Returns true if the process identified by the handle passed in is an
54 // immersive (Metro) process.
55 BASE_EXPORT
bool IsProcessImmersive(HANDLE process
);
57 // Returns true if this process is running under Text Services Framework (TSF)
58 // and browser must be TSF-aware.
59 BASE_EXPORT
bool IsTsfAwareRequired();
61 // Sets browser to use Text Service Framework (TSF) regardless of process
62 // status. On Windows 8, this function also disables CUAS (Cicero Unaware
63 // Application Support) to emulate Windows Metro mode in terms of IME
64 // functionality. This should be beneficial in QA process because on can test
65 // IME functionality in Windows 8 desktop mode.
66 BASE_EXPORT
void SetForceToUseTsf();
68 // Allocates and returns the destination string via the LocalAlloc API after
69 // copying the src to it.
70 BASE_EXPORT
wchar_t* LocalAllocAndCopyString(const string16
& src
);
72 // Returns true if the screen supports touch.
73 BASE_EXPORT
bool IsTouchEnabled();
75 // Returns true if Windows Parental control activity logging is enabled. This
76 // feature is available on Windows Vista and beyond.
77 // This function should ideally be called on the UI thread.
78 BASE_EXPORT
bool IsParentalControlActivityLoggingOn();
80 // Returns the type of launch and the activation params. For example if the
81 // the launch is for METRO_PROTOCOL then the params is a url.
82 BASE_EXPORT MetroLaunchType
GetMetroLaunchParams(string16
* params
);
84 // Handler function for the buttons on a metro dialog box
85 typedef void (*MetroDialogButtonPressedHandler
)();
87 // Handler function invoked when a metro style notification is clicked.
88 typedef void (*MetroNotificationClickedHandler
)(const wchar_t* context
);
90 // Function to display metro style notifications.
91 typedef void (*MetroNotification
)(const char* origin_url
,
95 const wchar_t* display_source
,
96 const char* notification_id
,
97 MetroNotificationClickedHandler handler
,
98 const wchar_t* handler_context
);
103 #endif // BASE_WIN_METRO_H_