| OLD | NEW |
| 1 // Copyright (c) 2009 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 #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 |
| 11 #include "base/ref_counted.h" | 11 #include "base/ref_counted.h" |
| (...skipping 20 matching lines...) Expand all Loading... |
| 32 Uninitialize(); | 32 Uninitialize(); |
| 33 } | 33 } |
| 34 | 34 |
| 35 BEGIN_MSG_MAP(T) | 35 BEGIN_MSG_MAP(T) |
| 36 MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus) | 36 MESSAGE_HANDLER(WM_SETFOCUS, OnSetFocus) |
| 37 MESSAGE_HANDLER(WM_SIZE, OnSize) | 37 MESSAGE_HANDLER(WM_SIZE, OnSize) |
| 38 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) | 38 MESSAGE_HANDLER(WM_PARENTNOTIFY, OnParentNotify) |
| 39 END_MSG_MAP() | 39 END_MSG_MAP() |
| 40 | 40 |
| 41 bool Initialize() { | 41 bool Initialize() { |
| 42 DLOG(INFO) << __FUNCTION__; | 42 DVLOG(1) << __FUNCTION__; |
| 43 DCHECK(!automation_client_.get()); | 43 DCHECK(!automation_client_.get()); |
| 44 automation_client_ = CreateAutomationClient(); | 44 automation_client_ = CreateAutomationClient(); |
| 45 if (!automation_client_.get()) { | 45 if (!automation_client_.get()) { |
| 46 NOTREACHED() << "new ChromeFrameAutomationClient"; | 46 NOTREACHED() << "new ChromeFrameAutomationClient"; |
| 47 return false; | 47 return false; |
| 48 } | 48 } |
| 49 | 49 |
| 50 return true; | 50 return true; |
| 51 } | 51 } |
| 52 | 52 |
| 53 void Uninitialize() { | 53 void Uninitialize() { |
| 54 DLOG(INFO) << __FUNCTION__; | 54 DVLOG(1) << __FUNCTION__; |
| 55 if (IsValid()) { | 55 if (IsValid()) { |
| 56 automation_client_->Uninitialize(); | 56 automation_client_->Uninitialize(); |
| 57 automation_client_ = NULL; | 57 automation_client_ = NULL; |
| 58 } | 58 } |
| 59 } | 59 } |
| 60 | 60 |
| 61 bool InitializeAutomation(const std::wstring& profile_name, | 61 bool InitializeAutomation(const std::wstring& profile_name, |
| 62 const std::wstring& extra_chrome_arguments, | 62 const std::wstring& extra_chrome_arguments, |
| 63 bool incognito, bool is_widget_mode, | 63 bool incognito, bool is_widget_mode, |
| 64 const GURL& url, const GURL& referrer, | 64 const GURL& url, const GURL& referrer, |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 225 // Allow overriding the type of automation client used, for unit tests. | 225 // Allow overriding the type of automation client used, for unit tests. |
| 226 virtual ChromeFrameAutomationClient* CreateAutomationClient() { | 226 virtual ChromeFrameAutomationClient* CreateAutomationClient() { |
| 227 return new ChromeFrameAutomationClient; | 227 return new ChromeFrameAutomationClient; |
| 228 } | 228 } |
| 229 | 229 |
| 230 void GiveFocusToChrome(bool restore_focus_to_view) { | 230 void GiveFocusToChrome(bool restore_focus_to_view) { |
| 231 if (IsValid()) { | 231 if (IsValid()) { |
| 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 DLOG(INFO) << "Setting initial focus"; | 235 DVLOG(1) << "Setting initial focus"; |
| 236 tab->SetInitialFocus(win_util::IsShiftPressed(), | 236 tab->SetInitialFocus(win_util::IsShiftPressed(), restore_focus_to_view); |
| 237 restore_focus_to_view); | |
| 238 } | 237 } |
| 239 } | 238 } |
| 240 } | 239 } |
| 241 | 240 |
| 242 virtual void GetProfilePath(const std::wstring& profile_name, | 241 virtual void GetProfilePath(const std::wstring& profile_name, |
| 243 FilePath* profile_path) { | 242 FilePath* profile_path) { |
| 244 chrome::GetChromeFrameUserDataDirectory(profile_path); | 243 chrome::GetChromeFrameUserDataDirectory(profile_path); |
| 245 *profile_path = profile_path->Append(profile_name); | 244 *profile_path = profile_path->Append(profile_name); |
| 246 DLOG(INFO) << __FUNCTION__ << ": " << profile_path->value(); | 245 DVLOG(1) << __FUNCTION__ << ": " << profile_path->value(); |
| 247 } | 246 } |
| 248 | 247 |
| 249 protected: | 248 protected: |
| 250 // Our gateway to chrome land | 249 // Our gateway to chrome land |
| 251 scoped_refptr<ChromeFrameAutomationClient> automation_client_; | 250 scoped_refptr<ChromeFrameAutomationClient> automation_client_; |
| 252 | 251 |
| 253 // How we launched Chrome. | 252 // How we launched Chrome. |
| 254 scoped_refptr<ChromeFrameLaunchParams> launch_params_; | 253 scoped_refptr<ChromeFrameLaunchParams> launch_params_; |
| 255 | 254 |
| 256 // Url of the containing document. | 255 // Url of the containing document. |
| (...skipping 14 matching lines...) Expand all Loading... |
| 271 | 270 |
| 272 // List of functions to enable for automation, or a single entry "*" to | 271 // List of functions to enable for automation, or a single entry "*" to |
| 273 // enable all functions for automation. Ignored unless is_privileged_ is | 272 // enable all functions for automation. Ignored unless is_privileged_ is |
| 274 // true. Defaults to the empty list, meaning automation will not be | 273 // true. Defaults to the empty list, meaning automation will not be |
| 275 // turned on. | 274 // turned on. |
| 276 std::vector<std::string> functions_enabled_; | 275 std::vector<std::string> functions_enabled_; |
| 277 }; | 276 }; |
| 278 | 277 |
| 279 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ | 278 #endif // CHROME_FRAME_CHROME_FRAME_PLUGIN_H_ |
| 280 | 279 |
| OLD | NEW |