OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_CHROME_FRAME_PLUGIN_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
6 #define CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
59 | 59 |
60 void Uninitialize() { | 60 void Uninitialize() { |
61 DVLOG(1) << __FUNCTION__; | 61 DVLOG(1) << __FUNCTION__; |
62 if (IsValid()) { | 62 if (IsValid()) { |
63 automation_client_->Uninitialize(); | 63 automation_client_->Uninitialize(); |
64 automation_client_ = NULL; | 64 automation_client_ = NULL; |
65 } | 65 } |
66 } | 66 } |
67 | 67 |
68 bool InitializeAutomation(const std::wstring& profile_name, | 68 bool InitializeAutomation(const std::wstring& profile_name, |
69 const std::wstring& extra_chrome_arguments, | |
70 bool incognito, bool is_widget_mode, | 69 bool incognito, bool is_widget_mode, |
71 const GURL& url, const GURL& referrer, | 70 const GURL& url, const GURL& referrer, |
72 bool route_all_top_level_navigations) { | 71 bool route_all_top_level_navigations) { |
73 DCHECK(IsValid()); | 72 DCHECK(IsValid()); |
74 DCHECK(launch_params_ == NULL); | 73 DCHECK(launch_params_ == NULL); |
75 // We don't want to do incognito when privileged, since we're | 74 // We don't want to do incognito when privileged, since we're |
76 // running in browser chrome or some other privileged context. | 75 // running in browser chrome or some other privileged context. |
77 bool incognito_mode = !is_privileged() && incognito; | 76 bool incognito_mode = !is_privileged() && incognito; |
78 FilePath profile_path; | 77 FilePath profile_path; |
79 GetProfilePath(profile_name, &profile_path); | 78 GetProfilePath(profile_name, &profile_path); |
80 // The profile name could change based on the browser version. For e.g. for | 79 // The profile name could change based on the browser version. For e.g. for |
81 // IE6/7 the profile is created in a different folder whose last component | 80 // IE6/7 the profile is created in a different folder whose last component |
82 // is Google Chrome Frame. | 81 // is Google Chrome Frame. |
83 FilePath actual_profile_name = profile_path.BaseName(); | 82 FilePath actual_profile_name = profile_path.BaseName(); |
84 launch_params_ = new ChromeFrameLaunchParams(url, referrer, profile_path, | 83 launch_params_ = new ChromeFrameLaunchParams(url, referrer, profile_path, |
85 actual_profile_name.value(), SimpleResourceLoader::GetLanguage(), | 84 actual_profile_name.value(), SimpleResourceLoader::GetLanguage(), |
86 extra_chrome_arguments, incognito_mode, is_widget_mode, | 85 incognito_mode, is_widget_mode, route_all_top_level_navigations); |
87 route_all_top_level_navigations); | |
88 return automation_client_->Initialize(this, launch_params_); | 86 return automation_client_->Initialize(this, launch_params_); |
89 } | 87 } |
90 | 88 |
91 // ChromeFrameDelegate implementation | 89 // ChromeFrameDelegate implementation |
92 virtual WindowType GetWindow() const { | 90 virtual WindowType GetWindow() const { |
93 return (static_cast<const T*>(this))->m_hWnd; | 91 return (static_cast<const T*>(this))->m_hWnd; |
94 } | 92 } |
95 | 93 |
96 virtual void GetBounds(RECT* bounds) { | 94 virtual void GetBounds(RECT* bounds) { |
97 if (bounds) { | 95 if (bounds) { |
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
256 // Url of the containing document. | 254 // Url of the containing document. |
257 std::string document_url_; | 255 std::string document_url_; |
258 | 256 |
259 // We set this flag when we're taking the focus ourselves | 257 // We set this flag when we're taking the focus ourselves |
260 // and notifying the host browser that we're doing so. | 258 // and notifying the host browser that we're doing so. |
261 // When the flag is not set, we transfer the focus to chrome. | 259 // When the flag is not set, we transfer the focus to chrome. |
262 bool ignore_setfocus_; | 260 bool ignore_setfocus_; |
263 }; | 261 }; |
264 | 262 |
265 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 263 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
OLD | NEW |