| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 CHROME_FRAME_UTILS_H_ | 5 #ifndef CHROME_FRAME_UTILS_H_ |
| 6 #define CHROME_FRAME_UTILS_H_ | 6 #define CHROME_FRAME_UTILS_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <string> | 9 #include <string> |
| 10 #include <UrlMon.h> | 10 #include <UrlMon.h> |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 | 174 |
| 175 // Returns true iff the two urls have the same scheme, same host and same port. | 175 // Returns true iff the two urls have the same scheme, same host and same port. |
| 176 bool HaveSameOrigin(const std::string& url1, const std::string& url2); | 176 bool HaveSameOrigin(const std::string& url1, const std::string& url2); |
| 177 | 177 |
| 178 // Get a boolean configuration value from registry. | 178 // Get a boolean configuration value from registry. |
| 179 bool GetConfigBool(bool default_value, const wchar_t* value_name); | 179 bool GetConfigBool(bool default_value, const wchar_t* value_name); |
| 180 | 180 |
| 181 // Gets an integer configuration value from the registry. | 181 // Gets an integer configuration value from the registry. |
| 182 int GetConfigInt(int default_value, const wchar_t* value_name); | 182 int GetConfigInt(int default_value, const wchar_t* value_name); |
| 183 | 183 |
| 184 // Sets an integer configuration value in the registry. |
| 185 bool SetConfigInt(const wchar_t* value_name, int value); |
| 186 |
| 187 // Sets a boolean integer configuration value in the registry. |
| 188 bool SetConfigBool(const wchar_t* value_name, bool value); |
| 189 |
| 190 // Deletes the configuration value passed in. |
| 191 bool DeleteConfigValue(const wchar_t* value_name); |
| 192 |
| 193 // Returns true if we are running in headless mode in which case we need to |
| 194 // gather crash dumps, etc to send them to the crash server. |
| 195 bool IsHeadlessMode(); |
| 196 |
| 184 // Check if this url is opting into Chrome Frame based on static settings. | 197 // Check if this url is opting into Chrome Frame based on static settings. |
| 185 bool IsOptInUrl(const wchar_t* url); | 198 bool IsOptInUrl(const wchar_t* url); |
| 186 | 199 |
| 187 // A shortcut for QueryService | 200 // A shortcut for QueryService |
| 188 template <typename T> | 201 template <typename T> |
| 189 HRESULT DoQueryService(const IID& service_id, IUnknown* unk, T** service) { | 202 HRESULT DoQueryService(const IID& service_id, IUnknown* unk, T** service) { |
| 190 DCHECK(service); | 203 DCHECK(service); |
| 191 if (!unk) | 204 if (!unk) |
| 192 return E_INVALIDARG; | 205 return E_INVALIDARG; |
| 193 ScopedComPtr<IServiceProvider> service_provider; | 206 ScopedComPtr<IServiceProvider> service_provider; |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 271 // delegate() method that returns a pointer to the delegated COM object. | 284 // delegate() method that returns a pointer to the delegated COM object. |
| 272 #define COM_INTERFACE_ENTRY_IF_DELEGATE_SUPPORTS(x) \ | 285 #define COM_INTERFACE_ENTRY_IF_DELEGATE_SUPPORTS(x) \ |
| 273 COM_INTERFACE_ENTRY_FUNC(_ATL_IIDOF(x), \ | 286 COM_INTERFACE_ENTRY_FUNC(_ATL_IIDOF(x), \ |
| 274 offsetofclass(x, _ComMapClass), \ | 287 offsetofclass(x, _ComMapClass), \ |
| 275 QueryInterfaceIfDelegateSupports<_ComMapClass>) | 288 QueryInterfaceIfDelegateSupports<_ComMapClass>) |
| 276 | 289 |
| 277 // Queries the delegated COM object for an interface, bypassing the wrapper. | 290 // Queries the delegated COM object for an interface, bypassing the wrapper. |
| 278 #define COM_INTERFACE_BLIND_DELEGATE() \ | 291 #define COM_INTERFACE_BLIND_DELEGATE() \ |
| 279 COM_INTERFACE_ENTRY_FUNC_BLIND(0, CheckOutgoingInterface<_ComMapClass>) | 292 COM_INTERFACE_ENTRY_FUNC_BLIND(0, CheckOutgoingInterface<_ComMapClass>) |
| 280 | 293 |
| 294 extern const wchar_t kChromeFrameHeadlessMode[]; |
| 295 |
| 281 #endif // CHROME_FRAME_UTILS_H_ | 296 #endif // CHROME_FRAME_UTILS_H_ |
| OLD | NEW |