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 // 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 309 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
320 void SetBookmarkTitle(int handle, | 320 void SetBookmarkTitle(int handle, |
321 int64 id, std::wstring title, | 321 int64 id, std::wstring title, |
322 bool* success); | 322 bool* success); |
323 void SetBookmarkURL(int handle, | 323 void SetBookmarkURL(int handle, |
324 int64 id, const GURL& url, | 324 int64 id, const GURL& url, |
325 bool* success); | 325 bool* success); |
326 void RemoveBookmark(int handle, | 326 void RemoveBookmark(int handle, |
327 int64 id, | 327 int64 id, |
328 bool* success); | 328 bool* success); |
329 | 329 |
| 330 // Util for creating a JSON error return string (dict with key |
| 331 // 'error' and error string value). No need to quote input. |
| 332 std::string JSONErrorString(std::string err); |
| 333 |
330 // Set window dimensions. | 334 // Set window dimensions. |
331 // Uses the JSON interface for input/output. | 335 // Uses the JSON interface for input/output. |
332 void SetWindowDimensions(Browser* browser, | 336 void SetWindowDimensions(Browser* browser, |
333 DictionaryValue* args, | 337 DictionaryValue* args, |
334 IPC::Message* reply_message); | 338 IPC::Message* reply_message); |
335 | 339 |
336 // Get info about the chromium/chrome in use. | 340 // Get info about the chromium/chrome in use. |
337 // This includes things like version, executable name, executable path. | 341 // This includes things like version, executable name, executable path. |
338 // Uses the JSON interface for input/output. | 342 // Uses the JSON interface for input/output. |
339 void GetBrowserInfo(Browser* browser, | 343 void GetBrowserInfo(Browser* browser, |
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
425 IPC::Message* reply_message); | 429 IPC::Message* reply_message); |
426 | 430 |
427 // Accept the current string of text in the omnibox. | 431 // Accept the current string of text in the omnibox. |
428 // This is equivalent to clicking or hiting enter on a popup selection. | 432 // This is equivalent to clicking or hiting enter on a popup selection. |
429 // Blocks until the page loads. | 433 // Blocks until the page loads. |
430 // Uses the JSON interface for input/output. | 434 // Uses the JSON interface for input/output. |
431 void OmniboxAcceptInput(Browser* browser, | 435 void OmniboxAcceptInput(Browser* browser, |
432 DictionaryValue* args, | 436 DictionaryValue* args, |
433 IPC::Message* reply_message); | 437 IPC::Message* reply_message); |
434 | 438 |
| 439 // Save the contents of a tab into a file. |
| 440 // Uses the JSON interface for input/output. |
| 441 void SaveTabContents(Browser* browser, |
| 442 DictionaryValue* args, |
| 443 IPC::Message* reply_message); |
| 444 |
435 // Generic pattern for pyautolib | 445 // Generic pattern for pyautolib |
436 // Uses the JSON interface for input/output. | 446 // Uses the JSON interface for input/output. |
437 void SendJSONRequest(int handle, | 447 void SendJSONRequest(int handle, |
438 std::string json_request, | 448 std::string json_request, |
439 IPC::Message* reply_message); | 449 IPC::Message* reply_message); |
440 | 450 |
441 // Method ptr for json handlers. | 451 // Method ptr for json handlers. |
442 // Uses the JSON interface for input/output. | 452 // Uses the JSON interface for input/output. |
443 typedef void (AutomationProvider::*JsonHandler)(Browser* browser, | 453 typedef void (AutomationProvider::*JsonHandler)(Browser* browser, |
444 DictionaryValue*, | 454 DictionaryValue*, |
(...skipping 405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
850 virtual void Observe(NotificationType type, | 860 virtual void Observe(NotificationType type, |
851 const NotificationSource& source, | 861 const NotificationSource& source, |
852 const NotificationDetails& details); | 862 const NotificationDetails& details); |
853 | 863 |
854 void OnRemoveProvider(); // Called via PostTask | 864 void OnRemoveProvider(); // Called via PostTask |
855 | 865 |
856 NotificationRegistrar registrar_; | 866 NotificationRegistrar registrar_; |
857 }; | 867 }; |
858 | 868 |
859 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ | 869 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_H_ |
OLD | NEW |