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 | 10 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
189 | 189 |
190 // Get url (display name) from a moniker, |bind_context| is optional | 190 // Get url (display name) from a moniker, |bind_context| is optional |
191 HRESULT GetUrlFromMoniker(IMoniker* moniker, IBindCtx* bind_context, | 191 HRESULT GetUrlFromMoniker(IMoniker* moniker, IBindCtx* bind_context, |
192 std::wstring* url); | 192 std::wstring* url); |
193 | 193 |
194 // Returns true if the URL passed in is something which can be handled by | 194 // Returns true if the URL passed in is something which can be handled by |
195 // Chrome. If this function returns false then we should fail the navigation. | 195 // Chrome. If this function returns false then we should fail the navigation. |
196 // When is_privileged is true, chrome extension URLs will be considered valid. | 196 // When is_privileged is true, chrome extension URLs will be considered valid. |
197 bool IsValidUrlScheme(const std::wstring& url, bool is_privileged); | 197 bool IsValidUrlScheme(const std::wstring& url, bool is_privileged); |
198 | 198 |
199 // This returns the base directory in which to store user profiles. | |
200 bool GetUserProfileBaseDirectory(std::wstring* path); | |
201 | |
202 // See COM_INTERFACE_BLIND_DELEGATE below for details. | 199 // See COM_INTERFACE_BLIND_DELEGATE below for details. |
203 template <class T> | 200 template <class T> |
204 STDMETHODIMP CheckOutgoingInterface(void* obj, REFIID iid, void** ret, | 201 STDMETHODIMP CheckOutgoingInterface(void* obj, REFIID iid, void** ret, |
205 DWORD cookie) { | 202 DWORD cookie) { |
206 T* instance = reinterpret_cast<T*>(obj); | 203 T* instance = reinterpret_cast<T*>(obj); |
207 HRESULT hr = E_NOINTERFACE; | 204 HRESULT hr = E_NOINTERFACE; |
208 IUnknown* delegate = instance ? instance->delegate() : NULL; | 205 IUnknown* delegate = instance ? instance->delegate() : NULL; |
209 if (delegate) { | 206 if (delegate) { |
210 hr = delegate->QueryInterface(iid, ret); | 207 hr = delegate->QueryInterface(iid, ret); |
211 #if !defined(NDEBUG) | 208 #if !defined(NDEBUG) |
(...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
249 #define COM_INTERFACE_ENTRY_IF_DELEGATE_SUPPORTS(x) \ | 246 #define COM_INTERFACE_ENTRY_IF_DELEGATE_SUPPORTS(x) \ |
250 COM_INTERFACE_ENTRY_FUNC(_ATL_IIDOF(x), \ | 247 COM_INTERFACE_ENTRY_FUNC(_ATL_IIDOF(x), \ |
251 offsetofclass(x, _ComMapClass), \ | 248 offsetofclass(x, _ComMapClass), \ |
252 QueryInterfaceIfDelegateSupports<_ComMapClass>) | 249 QueryInterfaceIfDelegateSupports<_ComMapClass>) |
253 | 250 |
254 // Queries the delegated COM object for an interface, bypassing the wrapper. | 251 // Queries the delegated COM object for an interface, bypassing the wrapper. |
255 #define COM_INTERFACE_BLIND_DELEGATE() \ | 252 #define COM_INTERFACE_BLIND_DELEGATE() \ |
256 COM_INTERFACE_ENTRY_FUNC_BLIND(0, CheckOutgoingInterface<_ComMapClass>) | 253 COM_INTERFACE_ENTRY_FUNC_BLIND(0, CheckOutgoingInterface<_ComMapClass>) |
257 | 254 |
258 #endif // CHROME_FRAME_UTILS_H_ | 255 #endif // CHROME_FRAME_UTILS_H_ |
OLD | NEW |