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 // 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 128 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
139 virtual void OnChannelConnected(int pid) OVERRIDE; | 139 virtual void OnChannelConnected(int pid) OVERRIDE; |
140 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; | 140 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; |
141 virtual void OnChannelError() OVERRIDE; | 141 virtual void OnChannelError() OVERRIDE; |
142 | 142 |
143 IPC::Message* reply_message_release() { | 143 IPC::Message* reply_message_release() { |
144 IPC::Message* reply_message = reply_message_; | 144 IPC::Message* reply_message = reply_message_; |
145 reply_message_ = NULL; | 145 reply_message_ = NULL; |
146 return reply_message; | 146 return reply_message; |
147 } | 147 } |
148 | 148 |
149 #if defined(OS_WIN) && !defined(USE_AURA) | 149 #if defined(OS_WIN) |
150 // Adds the external tab passed in to the tab tracker. | 150 // Adds the external tab passed in to the tab tracker. |
151 bool AddExternalTab(ExternalTabContainer* external_tab); | 151 bool AddExternalTab(ExternalTabContainer* external_tab); |
152 #endif | 152 #endif |
153 | 153 |
154 // Get the DictionaryValue equivalent for a download item. Caller owns the | 154 // Get the DictionaryValue equivalent for a download item. Caller owns the |
155 // DictionaryValue. | 155 // DictionaryValue. |
156 base::DictionaryValue* GetDictionaryFromDownloadItem( | 156 base::DictionaryValue* GetDictionaryFromDownloadItem( |
157 const content::DownloadItem* download, | 157 const content::DownloadItem* download, |
158 bool incognito); | 158 bool incognito); |
159 | 159 |
(...skipping 118 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 | 278 |
279 void KeyPress(int tab_handle, int key); | 279 void KeyPress(int tab_handle, int key); |
280 | 280 |
281 void ReloadAsync(int tab_handle); | 281 void ReloadAsync(int tab_handle); |
282 void StopAsync(int tab_handle); | 282 void StopAsync(int tab_handle); |
283 void SaveAsAsync(int tab_handle); | 283 void SaveAsAsync(int tab_handle); |
284 | 284 |
285 // Method called by the popup menu tracker when a popup menu is opened. | 285 // Method called by the popup menu tracker when a popup menu is opened. |
286 void NotifyPopupMenuOpened(); | 286 void NotifyPopupMenuOpened(); |
287 | 287 |
288 #if defined(OS_WIN) && !defined(USE_AURA) | 288 #if defined(OS_WIN) |
289 // The functions in this block are for use with external tabs, so they are | 289 // The functions in this block are for use with external tabs, so they are |
290 // Windows only. | 290 // Windows only. |
291 | 291 |
292 // The container of an externally hosted tab calls this to reflect any | 292 // The container of an externally hosted tab calls this to reflect any |
293 // accelerator keys that it did not process. This gives the tab a chance | 293 // accelerator keys that it did not process. This gives the tab a chance |
294 // to handle the keys | 294 // to handle the keys |
295 void ProcessUnhandledAccelerator(const IPC::Message& message, int handle, | 295 void ProcessUnhandledAccelerator(const IPC::Message& message, int handle, |
296 const MSG& msg); | 296 const MSG& msg); |
297 | 297 |
298 void SetInitialFocus(const IPC::Message& message, int handle, bool reverse, | 298 void SetInitialFocus(const IPC::Message& message, int handle, bool reverse, |
299 bool restore_focus_to_view); | 299 bool restore_focus_to_view); |
300 | 300 |
301 void OnTabReposition(int tab_handle, | 301 void OnTabReposition(int tab_handle, |
302 const Reposition_Params& params); | 302 const Reposition_Params& params); |
303 | 303 |
304 void OnForwardContextMenuCommandToChrome(int tab_handle, int command); | 304 void OnForwardContextMenuCommandToChrome(int tab_handle, int command); |
305 | 305 |
306 void CreateExternalTab(const ExternalTabSettings& settings, | 306 void CreateExternalTab(const ExternalTabSettings& settings, |
307 gfx::NativeWindow* tab_container_window, | 307 HWND* tab_container_window, |
308 gfx::NativeWindow* tab_window, | 308 HWND* tab_window, |
309 int* tab_handle, | 309 int* tab_handle, |
310 int* session_id); | 310 int* session_id); |
311 | 311 |
312 void ConnectExternalTab(uint64 cookie, | 312 void ConnectExternalTab(uint64 cookie, |
313 bool allow, | 313 bool allow, |
314 gfx::NativeWindow parent_window, | 314 HWND parent_window, |
315 gfx::NativeWindow* tab_container_window, | 315 HWND* tab_container_window, |
316 gfx::NativeWindow* tab_window, | 316 HWND* tab_window, |
317 int* tab_handle, | 317 int* tab_handle, |
318 int* session_id); | 318 int* session_id); |
319 | 319 |
320 void NavigateInExternalTab( | 320 void NavigateInExternalTab( |
321 int handle, const GURL& url, const GURL& referrer, | 321 int handle, const GURL& url, const GURL& referrer, |
322 AutomationMsg_NavigationResponseValues* status); | 322 AutomationMsg_NavigationResponseValues* status); |
323 void NavigateExternalTabAtIndex( | 323 void NavigateExternalTabAtIndex( |
324 int handle, int index, AutomationMsg_NavigationResponseValues* status); | 324 int handle, int index, AutomationMsg_NavigationResponseValues* status); |
325 | 325 |
326 // Handler for a message sent by the automation client. | 326 // Handler for a message sent by the automation client. |
327 void OnMessageFromExternalHost(int handle, const std::string& message, | 327 void OnMessageFromExternalHost(int handle, const std::string& message, |
328 const std::string& origin, | 328 const std::string& origin, |
329 const std::string& target); | 329 const std::string& target); |
330 | 330 |
331 void OnBrowserMoved(int handle); | 331 void OnBrowserMoved(int handle); |
332 | 332 |
333 void OnRunUnloadHandlers(int handle, IPC::Message* reply_message); | 333 void OnRunUnloadHandlers(int handle, IPC::Message* reply_message); |
334 | 334 |
335 void OnSetZoomLevel(int handle, int zoom_level); | 335 void OnSetZoomLevel(int handle, int zoom_level); |
336 | 336 |
337 ExternalTabContainer* GetExternalTabForHandle(int handle); | 337 ExternalTabContainer* GetExternalTabForHandle(int handle); |
338 #endif // defined(OS_WIN) && !defined(USE_AURA) | 338 #endif // defined(OS_WIN) |
339 | 339 |
340 scoped_ptr<IPC::ChannelProxy> channel_; | 340 scoped_ptr<IPC::ChannelProxy> channel_; |
341 scoped_ptr<NewTabUILoadObserver> new_tab_ui_load_observer_; | 341 scoped_ptr<NewTabUILoadObserver> new_tab_ui_load_observer_; |
342 scoped_ptr<FindInPageNotificationObserver> find_in_page_observer_; | 342 scoped_ptr<FindInPageNotificationObserver> find_in_page_observer_; |
343 | 343 |
344 // True iff we should enable observers that check for initial load conditions. | 344 // True iff we should enable observers that check for initial load conditions. |
345 bool use_initial_load_observers_; | 345 bool use_initial_load_observers_; |
346 | 346 |
347 // True iff connected to an AutomationProxy. | 347 // True iff connected to an AutomationProxy. |
348 bool is_connected_; | 348 bool is_connected_; |
(...skipping 11 matching lines...) Expand all Loading... |
360 std::string channel_id_; | 360 std::string channel_id_; |
361 | 361 |
362 // Trace data that has been collected but not flushed to the automation | 362 // Trace data that has been collected but not flushed to the automation |
363 // client. | 363 // client. |
364 TracingData tracing_data_; | 364 TracingData tracing_data_; |
365 | 365 |
366 DISALLOW_COPY_AND_ASSIGN(AutomationProvider); | 366 DISALLOW_COPY_AND_ASSIGN(AutomationProvider); |
367 }; | 367 }; |
368 | 368 |
369 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ | 369 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ |
OLD | NEW |