OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
67 | 67 |
68 bool InitializeAutomation(const std::wstring& profile_name, | 68 bool InitializeAutomation(const std::wstring& profile_name, |
69 bool incognito, bool is_widget_mode, | 69 bool incognito, bool is_widget_mode, |
70 const GURL& url, const GURL& referrer, | 70 const GURL& url, const GURL& referrer, |
71 bool route_all_top_level_navigations) { | 71 bool route_all_top_level_navigations) { |
72 DCHECK(IsValid()); | 72 DCHECK(IsValid()); |
73 DCHECK(launch_params_ == NULL); | 73 DCHECK(launch_params_ == NULL); |
74 // 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 |
75 // running in browser chrome or some other privileged context. | 75 // running in browser chrome or some other privileged context. |
76 bool incognito_mode = !is_privileged() && incognito; | 76 bool incognito_mode = !is_privileged() && incognito; |
77 FilePath profile_path; | 77 base::FilePath profile_path; |
78 GetProfilePath(profile_name, &profile_path); | 78 GetProfilePath(profile_name, &profile_path); |
79 // 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 |
80 // 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 |
81 // is Google Chrome Frame. | 81 // is Google Chrome Frame. |
82 FilePath actual_profile_name = profile_path.BaseName(); | 82 base::FilePath actual_profile_name = profile_path.BaseName(); |
83 launch_params_ = new ChromeFrameLaunchParams(url, referrer, profile_path, | 83 launch_params_ = new ChromeFrameLaunchParams(url, referrer, profile_path, |
84 actual_profile_name.value(), SimpleResourceLoader::GetLanguage(), | 84 actual_profile_name.value(), SimpleResourceLoader::GetLanguage(), |
85 incognito_mode, is_widget_mode, route_all_top_level_navigations, | 85 incognito_mode, is_widget_mode, route_all_top_level_navigations, |
86 automation_client_->send_shutdown_delay_switch()); | 86 automation_client_->send_shutdown_delay_switch()); |
87 return automation_client_->Initialize(this, launch_params_); | 87 return automation_client_->Initialize(this, launch_params_); |
88 } | 88 } |
89 | 89 |
90 // ChromeFrameDelegate implementation | 90 // ChromeFrameDelegate implementation |
91 virtual WindowType GetWindow() const { | 91 virtual WindowType GetWindow() const { |
92 return (static_cast<const T*>(this))->m_hWnd; | 92 return (static_cast<const T*>(this))->m_hWnd; |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 TabProxy* tab = automation_client_->tab(); | 232 TabProxy* tab = automation_client_->tab(); |
233 HWND chrome_window = automation_client_->tab_window(); | 233 HWND chrome_window = automation_client_->tab_window(); |
234 if (tab && ::IsWindow(chrome_window)) { | 234 if (tab && ::IsWindow(chrome_window)) { |
235 DVLOG(1) << "Setting initial focus"; | 235 DVLOG(1) << "Setting initial focus"; |
236 tab->SetInitialFocus(base::win::IsShiftPressed(), restore_focus_to_view)
; | 236 tab->SetInitialFocus(base::win::IsShiftPressed(), restore_focus_to_view)
; |
237 } | 237 } |
238 } | 238 } |
239 } | 239 } |
240 | 240 |
241 virtual void GetProfilePath(const std::wstring& profile_name, | 241 virtual void GetProfilePath(const std::wstring& profile_name, |
242 FilePath* profile_path) { | 242 base::FilePath* profile_path) { |
243 return GetChromeFrameProfilePath(profile_name, profile_path); | 243 return GetChromeFrameProfilePath(profile_name, profile_path); |
244 } | 244 } |
245 | 245 |
246 protected: | 246 protected: |
247 // Our gateway to chrome land | 247 // Our gateway to chrome land |
248 scoped_refptr<ChromeFrameAutomationClient> automation_client_; | 248 scoped_refptr<ChromeFrameAutomationClient> automation_client_; |
249 | 249 |
250 // How we launched Chrome. | 250 // How we launched Chrome. |
251 scoped_refptr<ChromeFrameLaunchParams> launch_params_; | 251 scoped_refptr<ChromeFrameLaunchParams> launch_params_; |
252 | 252 |
253 // Url of the containing document. | 253 // Url of the containing document. |
254 std::string document_url_; | 254 std::string document_url_; |
255 | 255 |
256 // We set this flag when we're taking the focus ourselves | 256 // We set this flag when we're taking the focus ourselves |
257 // and notifying the host browser that we're doing so. | 257 // and notifying the host browser that we're doing so. |
258 // When the flag is not set, we transfer the focus to chrome. | 258 // When the flag is not set, we transfer the focus to chrome. |
259 bool ignore_setfocus_; | 259 bool ignore_setfocus_; |
260 }; | 260 }; |
261 | 261 |
262 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 262 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
OLD | NEW |