| 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 #include <htiframe.h> | 5 #include <htiframe.h> |
| 6 #include <mshtml.h> | 6 #include <mshtml.h> |
| 7 #include <shlobj.h> | 7 #include <shlobj.h> |
| 8 #include <wininet.h> | 8 #include <wininet.h> |
| 9 | 9 |
| 10 #include "base/file_util.h" | 10 #include "base/file_util.h" |
| 11 #include "base/file_version_info.h" | 11 #include "base/file_version_info.h" |
| 12 #include "base/lazy_instance.h" | 12 #include "base/lazy_instance.h" |
| 13 #include "base/logging.h" | 13 #include "base/logging.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/registry.h" | 15 #include "base/registry.h" |
| 16 #include "base/scoped_bstr_win.h" | |
| 17 #include "base/scoped_comptr_win.h" | 16 #include "base/scoped_comptr_win.h" |
| 18 #include "base/scoped_variant_win.h" | 17 #include "base/scoped_variant_win.h" |
| 19 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 20 #include "base/thread_local.h" | 19 #include "base/thread_local.h" |
| 21 #include "base/utf_string_conversions.h" | 20 #include "base/utf_string_conversions.h" |
| 22 #include "chrome/common/url_constants.h" | 21 #include "chrome/common/url_constants.h" |
| 23 #include "chrome/installer/util/chrome_frame_distribution.h" | 22 #include "chrome/installer/util/chrome_frame_distribution.h" |
| 24 #include "chrome_frame/extra_system_apis.h" | 23 #include "chrome_frame/extra_system_apis.h" |
| 25 #include "chrome_frame/html_utils.h" | 24 #include "chrome_frame/html_utils.h" |
| 26 #include "chrome_frame/simple_resource_loader.h" | 25 #include "chrome_frame/simple_resource_loader.h" |
| (...skipping 378 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 } | 404 } |
| 406 } else { | 405 } else { |
| 407 NOTREACHED() << "Can't get IE version"; | 406 NOTREACHED() << "Can't get IE version"; |
| 408 } | 407 } |
| 409 } | 408 } |
| 410 } | 409 } |
| 411 | 410 |
| 412 return ie_version; | 411 return ie_version; |
| 413 } | 412 } |
| 414 | 413 |
| 415 FilePath GetIETemporaryFilesFolder() { | |
| 416 DCHECK_EQ(BROWSER_IE, GetBrowserType()); | |
| 417 | |
| 418 LPITEMIDLIST tif_pidl = NULL; | |
| 419 HRESULT hr = SHGetFolderLocation(NULL, CSIDL_INTERNET_CACHE, NULL, | |
| 420 SHGFP_TYPE_CURRENT, &tif_pidl); | |
| 421 DCHECK(SUCCEEDED(hr) && tif_pidl); | |
| 422 | |
| 423 ScopedComPtr<IShellFolder> parent_folder; | |
| 424 LPCITEMIDLIST relative_pidl = NULL; | |
| 425 hr = SHBindToParent(tif_pidl, IID_IShellFolder, | |
| 426 reinterpret_cast<void**>(parent_folder.Receive()), | |
| 427 &relative_pidl); | |
| 428 DCHECK(SUCCEEDED(hr) && relative_pidl); | |
| 429 | |
| 430 STRRET path = {0}; | |
| 431 hr = parent_folder->GetDisplayNameOf(relative_pidl, | |
| 432 SHGDN_NORMAL | SHGDN_FORPARSING, | |
| 433 &path); | |
| 434 DCHECK(SUCCEEDED(hr)); | |
| 435 ScopedBstr tif_bstr; | |
| 436 StrRetToBSTR(&path, relative_pidl, tif_bstr.Receive()); | |
| 437 FilePath tif(static_cast<BSTR>(tif_bstr)); | |
| 438 | |
| 439 ILFree(tif_pidl); | |
| 440 return tif; | |
| 441 } | |
| 442 | |
| 443 bool IsIEInPrivate() { | 414 bool IsIEInPrivate() { |
| 444 typedef BOOL (WINAPI* IEIsInPrivateBrowsingPtr)(); | 415 typedef BOOL (WINAPI* IEIsInPrivateBrowsingPtr)(); |
| 445 bool incognito_mode = false; | 416 bool incognito_mode = false; |
| 446 HMODULE h = GetModuleHandle(L"ieframe.dll"); | 417 HMODULE h = GetModuleHandle(L"ieframe.dll"); |
| 447 if (h) { | 418 if (h) { |
| 448 IEIsInPrivateBrowsingPtr IsInPrivate = | 419 IEIsInPrivateBrowsingPtr IsInPrivate = |
| 449 reinterpret_cast<IEIsInPrivateBrowsingPtr>(GetProcAddress(h, | 420 reinterpret_cast<IEIsInPrivateBrowsingPtr>(GetProcAddress(h, |
| 450 "IEIsInPrivateBrowsing")); | 421 "IEIsInPrivateBrowsing")); |
| 451 if (IsInPrivate) { | 422 if (IsInPrivate) { |
| 452 incognito_mode = !!IsInPrivate(); | 423 incognito_mode = !!IsInPrivate(); |
| (...skipping 489 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 942 case COOKIE_STATE_REJECT: | 913 case COOKIE_STATE_REJECT: |
| 943 cookie_action = COOKIEACTION_REJECT; | 914 cookie_action = COOKIEACTION_REJECT; |
| 944 break; | 915 break; |
| 945 default: | 916 default: |
| 946 cookie_action = COOKIEACTION_REJECT; | 917 cookie_action = COOKIEACTION_REJECT; |
| 947 break; | 918 break; |
| 948 } | 919 } |
| 949 return cookie_action; | 920 return cookie_action; |
| 950 } | 921 } |
| 951 | 922 |
| OLD | NEW |