| OLD | NEW |
| 1 // Copyright (c) 2010 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_AUTOMATION_H_ | 5 #ifndef CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| 6 #define CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 6 #define CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| 7 | 7 |
| 8 #include <atlbase.h> | 8 #include <atlbase.h> |
| 9 #include <atlwin.h> | 9 #include <atlwin.h> |
| 10 #include <string> | 10 #include <string> |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 103 }; | 103 }; |
| 104 | 104 |
| 105 // This class contains information used for launching chrome. | 105 // This class contains information used for launching chrome. |
| 106 class ChromeFrameLaunchParams : // NOLINT | 106 class ChromeFrameLaunchParams : // NOLINT |
| 107 public base::RefCountedThreadSafe<ChromeFrameLaunchParams> { | 107 public base::RefCountedThreadSafe<ChromeFrameLaunchParams> { |
| 108 public: | 108 public: |
| 109 ChromeFrameLaunchParams(const GURL& url, const GURL& referrer, | 109 ChromeFrameLaunchParams(const GURL& url, const GURL& referrer, |
| 110 const FilePath& profile_path, | 110 const FilePath& profile_path, |
| 111 const std::wstring& profile_name, | 111 const std::wstring& profile_name, |
| 112 const std::wstring& extra_arguments, | 112 const std::wstring& extra_arguments, |
| 113 bool incognito, bool widget_mode) | 113 bool incognito, bool widget_mode, |
| 114 bool route_all_top_level_navigations) |
| 114 : launch_timeout_(kCommandExecutionTimeout), url_(url), | 115 : launch_timeout_(kCommandExecutionTimeout), url_(url), |
| 115 referrer_(referrer), profile_path_(profile_path), | 116 referrer_(referrer), profile_path_(profile_path), |
| 116 profile_name_(profile_name), extra_arguments_(extra_arguments), | 117 profile_name_(profile_name), extra_arguments_(extra_arguments), |
| 117 version_check_(true), incognito_mode_(incognito), | 118 version_check_(true), incognito_mode_(incognito), |
| 118 is_widget_mode_(widget_mode) { | 119 is_widget_mode_(widget_mode), |
| 120 route_all_top_level_navigations_(route_all_top_level_navigations) { |
| 119 } | 121 } |
| 120 | 122 |
| 121 ~ChromeFrameLaunchParams() { | 123 ~ChromeFrameLaunchParams() { |
| 122 } | 124 } |
| 123 | 125 |
| 124 void set_launch_timeout(int timeout) { | 126 void set_launch_timeout(int timeout) { |
| 125 launch_timeout_ = timeout; | 127 launch_timeout_ = timeout; |
| 126 } | 128 } |
| 127 | 129 |
| 128 int launch_timeout() const { | 130 int launch_timeout() const { |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 166 } | 168 } |
| 167 | 169 |
| 168 bool incognito() const { | 170 bool incognito() const { |
| 169 return incognito_mode_; | 171 return incognito_mode_; |
| 170 } | 172 } |
| 171 | 173 |
| 172 bool widget_mode() const { | 174 bool widget_mode() const { |
| 173 return is_widget_mode_; | 175 return is_widget_mode_; |
| 174 } | 176 } |
| 175 | 177 |
| 178 void set_route_all_top_level_navigations( |
| 179 bool route_all_top_level_navigations) { |
| 180 route_all_top_level_navigations_ = route_all_top_level_navigations; |
| 181 } |
| 182 |
| 183 bool route_all_top_level_navigations() const { |
| 184 return route_all_top_level_navigations_; |
| 185 } |
| 186 |
| 176 protected: | 187 protected: |
| 177 int launch_timeout_; | 188 int launch_timeout_; |
| 178 GURL url_; | 189 GURL url_; |
| 179 GURL referrer_; | 190 GURL referrer_; |
| 180 FilePath profile_path_; | 191 FilePath profile_path_; |
| 181 std::wstring profile_name_; | 192 std::wstring profile_name_; |
| 182 std::wstring extra_arguments_; | 193 std::wstring extra_arguments_; |
| 183 bool version_check_; | 194 bool version_check_; |
| 184 bool incognito_mode_; | 195 bool incognito_mode_; |
| 185 bool is_widget_mode_; | 196 bool is_widget_mode_; |
| 197 bool route_all_top_level_navigations_; |
| 186 | 198 |
| 187 private: | 199 private: |
| 188 DISALLOW_COPY_AND_ASSIGN(ChromeFrameLaunchParams); | 200 DISALLOW_COPY_AND_ASSIGN(ChromeFrameLaunchParams); |
| 189 }; | 201 }; |
| 190 | 202 |
| 191 // Callback when chrome process launch is complete and automation handshake | 203 // Callback when chrome process launch is complete and automation handshake |
| 192 // (Hello message) is established. | 204 // (Hello message) is established. |
| 193 struct DECLSPEC_NOVTABLE LaunchDelegate { // NOLINT | 205 struct DECLSPEC_NOVTABLE LaunchDelegate { // NOLINT |
| 194 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, | 206 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, |
| 195 AutomationLaunchResult result) = 0; | 207 AutomationLaunchResult result) = 0; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 415 // For IDeleteBrowsingHistorySupport | 427 // For IDeleteBrowsingHistorySupport |
| 416 void RemoveBrowsingData(int remove_mask); | 428 void RemoveBrowsingData(int remove_mask); |
| 417 | 429 |
| 418 // Sets the current zoom level on the tab. | 430 // Sets the current zoom level on the tab. |
| 419 void SetZoomLevel(PageZoom::Function zoom_level); | 431 void SetZoomLevel(PageZoom::Function zoom_level); |
| 420 | 432 |
| 421 // Fires before unload and unload handlers on the page if any. Allows the | 433 // Fires before unload and unload handlers on the page if any. Allows the |
| 422 // the website to put up a confirmation dialog on unload. | 434 // the website to put up a confirmation dialog on unload. |
| 423 void OnUnload(bool* should_unload); | 435 void OnUnload(bool* should_unload); |
| 424 | 436 |
| 437 void set_route_all_top_level_navigations( |
| 438 bool route_all_top_level_navigations) { |
| 439 route_all_top_level_navigations_ = route_all_top_level_navigations; |
| 440 } |
| 441 |
| 425 protected: | 442 protected: |
| 426 // ChromeFrameAutomationProxy::LaunchDelegate implementation. | 443 // ChromeFrameAutomationProxy::LaunchDelegate implementation. |
| 427 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, | 444 virtual void LaunchComplete(ChromeFrameAutomationProxy* proxy, |
| 428 AutomationLaunchResult result); | 445 AutomationLaunchResult result); |
| 429 virtual void AutomationServerDied(); | 446 virtual void AutomationServerDied(); |
| 430 | 447 |
| 431 // TabProxyDelegate implementation | 448 // TabProxyDelegate implementation |
| 432 virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg); | 449 virtual void OnMessageReceived(TabProxy* tab, const IPC::Message& msg); |
| 433 virtual void OnChannelError(TabProxy* tab); | 450 virtual void OnChannelError(TabProxy* tab); |
| 434 | 451 |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 516 scoped_refptr<ChromeFrameLaunchParams> chrome_launch_params_; | 533 scoped_refptr<ChromeFrameLaunchParams> chrome_launch_params_; |
| 517 | 534 |
| 518 // Cache security manager for URL zone checking | 535 // Cache security manager for URL zone checking |
| 519 ScopedComPtr<IInternetSecurityManager> security_manager_; | 536 ScopedComPtr<IInternetSecurityManager> security_manager_; |
| 520 | 537 |
| 521 // When host network stack is used, this object is in charge of | 538 // When host network stack is used, this object is in charge of |
| 522 // handling network requests. | 539 // handling network requests. |
| 523 PluginUrlRequestManager* url_fetcher_; | 540 PluginUrlRequestManager* url_fetcher_; |
| 524 PluginUrlRequestManager::ThreadSafeFlags url_fetcher_flags_; | 541 PluginUrlRequestManager::ThreadSafeFlags url_fetcher_flags_; |
| 525 | 542 |
| 543 // set to true if the host needs to get notified of all top level navigations |
| 544 // in this page. This typically applies to hosts which would render the new |
| 545 // page without chrome frame. Defaults to false. |
| 546 bool route_all_top_level_navigations_; |
| 547 |
| 526 friend class BeginNavigateContext; | 548 friend class BeginNavigateContext; |
| 527 friend class CreateExternalTabContext; | 549 friend class CreateExternalTabContext; |
| 528 }; | 550 }; |
| 529 | 551 |
| 530 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ | 552 #endif // CHROME_FRAME_CHROME_FRAME_AUTOMATION_H_ |
| OLD | NEW |