| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 // This implements a browser-side endpoint for UI automation activity. | 5 // This implements a browser-side endpoint for UI automation activity. |
| 6 // The client-side endpoint is implemented by AutomationProxy. | 6 // The client-side endpoint is implemented by AutomationProxy. |
| 7 // The entire lifetime of this object should be contained within that of | 7 // The entire lifetime of this object should be contained within that of |
| 8 // the BrowserProcess, and in particular the NotificationService that's | 8 // the BrowserProcess, and in particular the NotificationService that's |
| 9 // hung off of it. | 9 // hung off of it. |
| 10 | 10 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 23 #include "chrome/browser/browser_list.h" | 23 #include "chrome/browser/browser_list.h" |
| 24 #include "chrome/browser/history/history.h" | 24 #include "chrome/browser/history/history.h" |
| 25 #include "chrome/common/ipc_channel_proxy.h" | 25 #include "chrome/common/ipc_channel_proxy.h" |
| 26 #include "chrome/common/ipc_message.h" | 26 #include "chrome/common/ipc_message.h" |
| 27 #include "chrome/common/notification_observer.h" | 27 #include "chrome/common/notification_observer.h" |
| 28 #include "chrome/views/event.h" | 28 #include "chrome/views/event.h" |
| 29 #include "webkit/glue/find_in_page_request.h" | 29 #include "webkit/glue/find_in_page_request.h" |
| 30 | 30 |
| 31 class LoginHandler; | 31 class LoginHandler; |
| 32 class NavigationControllerRestoredObserver; | 32 class NavigationControllerRestoredObserver; |
| 33 class ExternalTabContainer; | |
| 34 | 33 |
| 35 class AutomationProvider : public base::RefCounted<AutomationProvider>, | 34 class AutomationProvider : public base::RefCounted<AutomationProvider>, |
| 36 public IPC::Channel::Listener, | 35 public IPC::Channel::Listener, |
| 37 public IPC::Message::Sender { | 36 public IPC::Message::Sender { |
| 38 public: | 37 public: |
| 39 explicit AutomationProvider(Profile* profile); | 38 explicit AutomationProvider(Profile* profile); |
| 40 virtual ~AutomationProvider(); | 39 virtual ~AutomationProvider(); |
| 41 | 40 |
| 42 // Establishes a connection to an automation client, if present. | 41 // Establishes a connection to an automation client, if present. |
| 43 // An AutomationProxy should be established (probably in a different process) | 42 // An AutomationProxy should be established (probably in a different process) |
| (...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 242 void CreateExternalTab(const IPC::Message& message, HWND parent, | 241 void CreateExternalTab(const IPC::Message& message, HWND parent, |
| 243 const gfx::Rect& dimensions, unsigned int style); | 242 const gfx::Rect& dimensions, unsigned int style); |
| 244 void NavigateInExternalTab(const IPC::Message& message, int handle, | 243 void NavigateInExternalTab(const IPC::Message& message, int handle, |
| 245 const GURL& url); | 244 const GURL& url); |
| 246 // The container of an externally hosted tab calls this to reflect any | 245 // The container of an externally hosted tab calls this to reflect any |
| 247 // accelerator keys that it did not process. This gives the tab a chance | 246 // accelerator keys that it did not process. This gives the tab a chance |
| 248 // to handle the keys | 247 // to handle the keys |
| 249 void ProcessUnhandledAccelerator(const IPC::Message& message, int handle, | 248 void ProcessUnhandledAccelerator(const IPC::Message& message, int handle, |
| 250 const MSG& msg); | 249 const MSG& msg); |
| 251 | 250 |
| 252 void SetInitialFocus(const IPC::Message& message, int handle, bool reverse); | |
| 253 | |
| 254 // See comment in AutomationMsg_WaitForTabToBeRestored. | 251 // See comment in AutomationMsg_WaitForTabToBeRestored. |
| 255 void WaitForTabToBeRestored(const IPC::Message& message, int tab_handle); | 252 void WaitForTabToBeRestored(const IPC::Message& message, int tab_handle); |
| 256 | 253 |
| 257 // This sets the keyboard accelerators to be used by an externally | 254 // This sets the keyboard accelerators to be used by an externally |
| 258 // hosted tab. This call is not valid on a regular tab hosted within | 255 // hosted tab. This call is not valid on a regular tab hosted within |
| 259 // Chrome. | 256 // Chrome. |
| 260 void SetAcceleratorsForTab(const IPC::Message& message, int handle, | 257 void SetAcceleratorsForTab(const IPC::Message& message, int handle, |
| 261 HACCEL accel_table, int accel_entry_count); | 258 HACCEL accel_table, int accel_entry_count); |
| 262 | 259 |
| 263 // Gets the security state for the tab associated to the specified |handle|. | 260 // Gets the security state for the tab associated to the specified |handle|. |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 366 const std::wstring& encoding_name); | 363 const std::wstring& encoding_name); |
| 367 | 364 |
| 368 void SavePackageShouldPromptUser(const IPC::Message& message, | 365 void SavePackageShouldPromptUser(const IPC::Message& message, |
| 369 bool should_prompt); | 366 bool should_prompt); |
| 370 | 367 |
| 371 // Convert a tab handle into a WebContents. If |tab| is non-NULL a pointer | 368 // Convert a tab handle into a WebContents. If |tab| is non-NULL a pointer |
| 372 // to the tab is also returned. Returns NULL in case of failure or if the tab | 369 // to the tab is also returned. Returns NULL in case of failure or if the tab |
| 373 // is not of the WebContents type. | 370 // is not of the WebContents type. |
| 374 WebContents* GetWebContentsForHandle(int handle, NavigationController** tab); | 371 WebContents* GetWebContentsForHandle(int handle, NavigationController** tab); |
| 375 | 372 |
| 376 ExternalTabContainer* GetExternalTabForHandle(int handle); | |
| 377 | |
| 378 // Callback for history redirect queries. | 373 // Callback for history redirect queries. |
| 379 virtual void OnRedirectQueryComplete( | 374 virtual void OnRedirectQueryComplete( |
| 380 HistoryService::Handle request_handle, | 375 HistoryService::Handle request_handle, |
| 381 GURL from_url, | 376 GURL from_url, |
| 382 bool success, | 377 bool success, |
| 383 HistoryService::RedirectList* redirects); | 378 HistoryService::RedirectList* redirects); |
| 384 | 379 |
| 385 typedef ObserverList<NotificationObserver> NotificationObserverList; | 380 typedef ObserverList<NotificationObserver> NotificationObserverList; |
| 386 typedef std::map<NavigationController*, LoginHandler*> LoginHandlerMap; | 381 typedef std::map<NavigationController*, LoginHandler*> LoginHandlerMap; |
| 387 | 382 |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 444 | 439 |
| 445 private: | 440 private: |
| 446 virtual void Observe(NotificationType type, | 441 virtual void Observe(NotificationType type, |
| 447 const NotificationSource& source, | 442 const NotificationSource& source, |
| 448 const NotificationDetails& details); | 443 const NotificationDetails& details); |
| 449 | 444 |
| 450 void OnRemoveProvider(); // Called via PostTask | 445 void OnRemoveProvider(); // Called via PostTask |
| 451 }; | 446 }; |
| 452 | 447 |
| 453 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ | 448 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ |
| OLD | NEW |