| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "chrome_frame/test/chrome_frame_test_utils.h" | 5 #include "chrome_frame/test/chrome_frame_test_utils.h" |
| 6 | 6 |
| 7 #include <atlbase.h> | 7 #include <atlbase.h> |
| 8 #include <atlwin.h> | 8 #include <atlwin.h> |
| 9 #include <iepmapi.h> | 9 #include <iepmapi.h> |
| 10 #include <sddl.h> | 10 #include <sddl.h> |
| 11 | 11 |
| 12 #include "base/file_util.h" | 12 #include "base/file_util.h" |
| 13 #include "base/message_loop.h" | 13 #include "base/message_loop.h" |
| 14 #include "base/path_service.h" | 14 #include "base/path_service.h" |
| 15 #include "base/registry.h" // to find IE and firefox | 15 #include "base/registry.h" // to find IE and firefox |
| 16 #include "base/scoped_handle.h" | 16 #include "base/scoped_handle.h" |
| 17 #include "base/scoped_comptr_win.h" | 17 #include "base/scoped_comptr_win.h" |
| 18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
| 19 #include "base/win_util.h" | 19 #include "base/win_util.h" |
| 20 #include "chrome/common/chrome_switches.h" | 20 #include "chrome/common/chrome_switches.h" |
| 21 #include "chrome/common/chrome_paths.h" | |
| 22 #include "chrome/common/chrome_paths_internal.h" | |
| 23 #include "chrome_frame/utils.h" | 21 #include "chrome_frame/utils.h" |
| 24 | |
| 25 #include "testing/gtest/include/gtest/gtest.h" | 22 #include "testing/gtest/include/gtest/gtest.h" |
| 26 | 23 |
| 27 namespace chrome_frame_test { | 24 namespace chrome_frame_test { |
| 28 | 25 |
| 29 const int kDefaultWaitForIEToTerminateMs = 10 * 1000; | 26 const int kDefaultWaitForIEToTerminateMs = 10 * 1000; |
| 30 | 27 |
| 31 const wchar_t kIEImageName[] = L"iexplore.exe"; | 28 const wchar_t kIEImageName[] = L"iexplore.exe"; |
| 32 const wchar_t kIEBrokerImageName[] = L"ieuser.exe"; | 29 const wchar_t kIEBrokerImageName[] = L"ieuser.exe"; |
| 33 const wchar_t kFirefoxImageName[] = L"firefox.exe"; | 30 const wchar_t kFirefoxImageName[] = L"firefox.exe"; |
| 34 const wchar_t kOperaImageName[] = L"opera.exe"; | 31 const wchar_t kOperaImageName[] = L"opera.exe"; |
| (...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 357 cocreate_flags |= CLSCTX_ENABLE_CLOAKING; | 354 cocreate_flags |= CLSCTX_ENABLE_CLOAKING; |
| 358 } | 355 } |
| 359 | 356 |
| 360 hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL, | 357 hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL, |
| 361 cocreate_flags, IID_IWebBrowser2, | 358 cocreate_flags, IID_IWebBrowser2, |
| 362 reinterpret_cast<void**>(web_browser)); | 359 reinterpret_cast<void**>(web_browser)); |
| 363 // ~LowIntegrityToken() will switch integrity back to medium. | 360 // ~LowIntegrityToken() will switch integrity back to medium. |
| 364 return hr; | 361 return hr; |
| 365 } | 362 } |
| 366 | 363 |
| 367 FilePath GetProfilePath(const std::wstring& profile_name) { | |
| 368 FilePath profile_path; | |
| 369 chrome::GetChromeFrameUserDataDirectory(&profile_path); | |
| 370 return profile_path.Append(profile_name); | |
| 371 } | |
| 372 | |
| 373 _ATL_FUNC_INFO WebBrowserEventSink::kNavigateErrorInfo = { | 364 _ATL_FUNC_INFO WebBrowserEventSink::kNavigateErrorInfo = { |
| 374 CC_STDCALL, VT_EMPTY, 5, { | 365 CC_STDCALL, VT_EMPTY, 5, { |
| 375 VT_DISPATCH, | 366 VT_DISPATCH, |
| 376 VT_VARIANT | VT_BYREF, | 367 VT_VARIANT | VT_BYREF, |
| 377 VT_VARIANT | VT_BYREF, | 368 VT_VARIANT | VT_BYREF, |
| 378 VT_VARIANT | VT_BYREF, | 369 VT_VARIANT | VT_BYREF, |
| 379 VT_BOOL | VT_BYREF, | 370 VT_BOOL | VT_BYREF, |
| 380 } | 371 } |
| 381 }; | 372 }; |
| 382 | 373 |
| (...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 void WebBrowserEventSink::WatchChromeWindow(const wchar_t* window_class) { | 753 void WebBrowserEventSink::WatchChromeWindow(const wchar_t* window_class) { |
| 763 DCHECK(window_class); | 754 DCHECK(window_class); |
| 764 window_watcher_.AddObserver(this, WideToUTF8(window_class)); | 755 window_watcher_.AddObserver(this, WideToUTF8(window_class)); |
| 765 } | 756 } |
| 766 | 757 |
| 767 void WebBrowserEventSink::StopWatching() { | 758 void WebBrowserEventSink::StopWatching() { |
| 768 window_watcher_.RemoveObserver(this); | 759 window_watcher_.RemoveObserver(this); |
| 769 } | 760 } |
| 770 | 761 |
| 771 } // namespace chrome_frame_test | 762 } // namespace chrome_frame_test |
| OLD | NEW |