OLD | NEW |
1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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" |
21 #include "chrome_frame/utils.h" | 23 #include "chrome_frame/utils.h" |
| 24 |
22 #include "testing/gtest/include/gtest/gtest.h" | 25 #include "testing/gtest/include/gtest/gtest.h" |
23 | 26 |
24 namespace chrome_frame_test { | 27 namespace chrome_frame_test { |
25 | 28 |
26 const int kDefaultWaitForIEToTerminateMs = 10 * 1000; | 29 const int kDefaultWaitForIEToTerminateMs = 10 * 1000; |
27 | 30 |
28 const wchar_t kIEImageName[] = L"iexplore.exe"; | 31 const wchar_t kIEImageName[] = L"iexplore.exe"; |
29 const wchar_t kIEBrokerImageName[] = L"ieuser.exe"; | 32 const wchar_t kIEBrokerImageName[] = L"ieuser.exe"; |
30 const wchar_t kFirefoxImageName[] = L"firefox.exe"; | 33 const wchar_t kFirefoxImageName[] = L"firefox.exe"; |
31 const wchar_t kOperaImageName[] = L"opera.exe"; | 34 const wchar_t kOperaImageName[] = L"opera.exe"; |
(...skipping 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
354 cocreate_flags |= CLSCTX_ENABLE_CLOAKING; | 357 cocreate_flags |= CLSCTX_ENABLE_CLOAKING; |
355 } | 358 } |
356 | 359 |
357 hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL, | 360 hr = ::CoCreateInstance(CLSID_InternetExplorer, NULL, |
358 cocreate_flags, IID_IWebBrowser2, | 361 cocreate_flags, IID_IWebBrowser2, |
359 reinterpret_cast<void**>(web_browser)); | 362 reinterpret_cast<void**>(web_browser)); |
360 // ~LowIntegrityToken() will switch integrity back to medium. | 363 // ~LowIntegrityToken() will switch integrity back to medium. |
361 return hr; | 364 return hr; |
362 } | 365 } |
363 | 366 |
| 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 |
364 _ATL_FUNC_INFO WebBrowserEventSink::kNavigateErrorInfo = { | 373 _ATL_FUNC_INFO WebBrowserEventSink::kNavigateErrorInfo = { |
365 CC_STDCALL, VT_EMPTY, 5, { | 374 CC_STDCALL, VT_EMPTY, 5, { |
366 VT_DISPATCH, | 375 VT_DISPATCH, |
367 VT_VARIANT | VT_BYREF, | 376 VT_VARIANT | VT_BYREF, |
368 VT_VARIANT | VT_BYREF, | 377 VT_VARIANT | VT_BYREF, |
369 VT_VARIANT | VT_BYREF, | 378 VT_VARIANT | VT_BYREF, |
370 VT_BOOL | VT_BYREF, | 379 VT_BOOL | VT_BYREF, |
371 } | 380 } |
372 }; | 381 }; |
373 | 382 |
(...skipping 379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
753 void WebBrowserEventSink::WatchChromeWindow(const wchar_t* window_class) { | 762 void WebBrowserEventSink::WatchChromeWindow(const wchar_t* window_class) { |
754 DCHECK(window_class); | 763 DCHECK(window_class); |
755 window_watcher_.AddObserver(this, WideToUTF8(window_class)); | 764 window_watcher_.AddObserver(this, WideToUTF8(window_class)); |
756 } | 765 } |
757 | 766 |
758 void WebBrowserEventSink::StopWatching() { | 767 void WebBrowserEventSink::StopWatching() { |
759 window_watcher_.RemoveObserver(this); | 768 window_watcher_.RemoveObserver(this); |
760 } | 769 } |
761 | 770 |
762 } // namespace chrome_frame_test | 771 } // namespace chrome_frame_test |
OLD | NEW |