OLD | NEW |
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_WINRT_UTILS_H_ | 5 #ifndef WIN8_METRO_DRIVER_WINRT_UTILS_H_ |
6 #define WIN8_METRO_DRIVER_WINRT_UTILS_H_ | 6 #define WIN8_METRO_DRIVER_WINRT_UTILS_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 | 9 |
10 #include <roapi.h> | 10 #include <roapi.h> |
11 #include <windows.applicationmodel.core.h> | 11 #include <windows.applicationmodel.core.h> |
12 | 12 |
13 #include "base/strings/string16.h" | 13 #include "base/strings/string16.h" |
14 | 14 |
15 void CheckHR(HRESULT hr, const char* str = nullptr); | 15 void CheckHR(HRESULT hr, const char* str = nullptr); |
16 | 16 |
17 HSTRING MakeHString(const string16& str); | 17 HSTRING MakeHString(const base::string16& str); |
18 | 18 |
19 string16 MakeStdWString(HSTRING hstring); | 19 base::string16 MakeStdWString(HSTRING hstring); |
20 | 20 |
21 namespace winrt_utils { | 21 namespace winrt_utils { |
22 | 22 |
23 template<unsigned int size, typename T> | 23 template<unsigned int size, typename T> |
24 HRESULT CreateActivationFactory(wchar_t const (&class_name)[size], T** object) { | 24 HRESULT CreateActivationFactory(wchar_t const (&class_name)[size], T** object) { |
25 mswrw::HStringReference ref_class_name(class_name); | 25 mswrw::HStringReference ref_class_name(class_name); |
26 return winfoundtn::GetActivationFactory(ref_class_name.Get(), object); | 26 return winfoundtn::GetActivationFactory(ref_class_name.Get(), object); |
27 } | 27 } |
28 | 28 |
29 #define DECLARE_CREATE_PROPERTY(Name, Type) \ | 29 #define DECLARE_CREATE_PROPERTY(Name, Type) \ |
(...skipping 16 matching lines...) Expand all Loading... |
46 // +1 if |lhs| is greater than |rhs|. | 46 // +1 if |lhs| is greater than |rhs|. |
47 HRESULT CompareProperties( | 47 HRESULT CompareProperties( |
48 winfoundtn::IPropertyValue* lhs, winfoundtn::IPropertyValue* rhs, | 48 winfoundtn::IPropertyValue* lhs, winfoundtn::IPropertyValue* rhs, |
49 INT32* result); | 49 INT32* result); |
50 | 50 |
51 // Looks for a pinned taskbar shortcut in the current user's profile. If it | 51 // Looks for a pinned taskbar shortcut in the current user's profile. If it |
52 // finds one, will return any arguments that have been appended to the | 52 // finds one, will return any arguments that have been appended to the |
53 // shortcut's command line. This is intended for scenarios where those shortcut | 53 // shortcut's command line. This is intended for scenarios where those shortcut |
54 // parameters are ordinarily ignored (i.e. metro apps on win8). Returns an | 54 // parameters are ordinarily ignored (i.e. metro apps on win8). Returns an |
55 // empty string on failure. | 55 // empty string on failure. |
56 string16 ReadArgumentsFromPinnedTaskbarShortcut(); | 56 base::string16 ReadArgumentsFromPinnedTaskbarShortcut(); |
57 | 57 |
58 } // namespace winrt_utils | 58 } // namespace winrt_utils |
59 | 59 |
60 #endif // WIN8_METRO_DRIVER_WINRT_UTILS_H_ | 60 #endif // WIN8_METRO_DRIVER_WINRT_UTILS_H_ |
OLD | NEW |