Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(239)

Side by Side Diff: chrome/browser/automation/testing_automation_provider.h

Issue 10534163: First pass at refactoring pyautolib in preparation for removing proxy dependencies. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Addressed comments. Created 8 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 5 #ifndef CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 6 #define CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
7 #pragma once 7 #pragma once
8 8
9 #include <map> 9 #include <map>
10 #include <string> 10 #include <string>
(...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after
240 IPC::Message* reply_message); 240 IPC::Message* reply_message);
241 241
242 void GoForwardBlockUntilNavigationsComplete(int handle, 242 void GoForwardBlockUntilNavigationsComplete(int handle,
243 int number_of_navigations, 243 int number_of_navigations,
244 IPC::Message* reply_message); 244 IPC::Message* reply_message);
245 245
246 void SetShelfVisibility(int handle, bool visible); 246 void SetShelfVisibility(int handle, bool visible);
247 247
248 // Generic pattern for pyautolib 248 // Generic pattern for pyautolib
249 // Uses the JSON interface for input/output. 249 // Uses the JSON interface for input/output.
250 void SendJSONRequest(int handle, 250 void SendJSONRequestWithBrowserHandle(int handle,
251 const std::string& json_request,
252 IPC::Message* reply_message);
253 void SendJSONRequestWithBrowserIndex(int index,
254 const std::string& json_request,
255 IPC::Message* reply_message);
256 void SendJSONRequest(Browser* browser,
251 const std::string& json_request, 257 const std::string& json_request,
252 IPC::Message* reply_message); 258 IPC::Message* reply_message);
253 259
254 // Method ptr for json handlers. 260 // Method ptr for json handlers.
255 // Uses the JSON interface for input/output. 261 // Uses the JSON interface for input/output.
256 typedef void (TestingAutomationProvider::*JsonHandler)(base::DictionaryValue*, 262 typedef void (TestingAutomationProvider::*JsonHandler)(base::DictionaryValue*,
257 IPC::Message*); 263 IPC::Message*);
258 264
259 // Method ptr for json handlers that take a browser argument. 265 // Method ptr for json handlers that take a browser argument.
260 // Uses the JSON interface for input/output. 266 // Uses the JSON interface for input/output.
261 typedef void (TestingAutomationProvider::*BrowserJsonHandler)( 267 typedef void (TestingAutomationProvider::*BrowserJsonHandler)(
262 Browser* browser, 268 Browser* browser,
263 base::DictionaryValue*, 269 base::DictionaryValue*,
264 IPC::Message*); 270 IPC::Message*);
265 271
272 // JSON interface helper functions.
273 static scoped_ptr<DictionaryValue*> ParseJSONRequestCommand(
kkania 2012/06/19 16:20:12 I think you want scoped_ptr<DictionaryValue>
craigdh 2012/06/19 23:28:52 Yes, compiler caught that one but I forgot to re-u
274 const std::string& json_request,
275 std::string* command,
276 std::string* error);
277 void BuildJSONHandlerMaps();
278
266 // Set window dimensions. 279 // Set window dimensions.
267 // Uses the JSON interface for input/output. 280 // Uses the JSON interface for input/output.
268 void SetWindowDimensions(Browser* browser, 281 void SetWindowDimensions(Browser* browser,
269 base::DictionaryValue* args, 282 base::DictionaryValue* args,
270 IPC::Message* reply_message); 283 IPC::Message* reply_message);
271 284
272 // Get info about infobars in the given WebContents object. 285 // Get info about infobars in the given WebContents object.
273 // This includes info about the type of infobars, the message text, 286 // This includes info about the type of infobars, the message text,
274 // buttons, etc. 287 // buttons, etc.
275 // Caller owns the returned object. 288 // Caller owns the returned object.
(...skipping 1261 matching lines...) Expand 10 before | Expand all | Expand 10 after
1537 1550
1538 // Selects the given |browser| and |tab| if not selected already. 1551 // Selects the given |browser| and |tab| if not selected already.
1539 void EnsureTabSelected(Browser* browser, content::WebContents* tab); 1552 void EnsureTabSelected(Browser* browser, content::WebContents* tab);
1540 1553
1541 #if defined(OS_CHROMEOS) 1554 #if defined(OS_CHROMEOS)
1542 // Avoid scoped ptr here to avoid having to define it completely in the 1555 // Avoid scoped ptr here to avoid having to define it completely in the
1543 // non-ChromeOS code. 1556 // non-ChromeOS code.
1544 PowerManagerClientObserverForTesting* power_manager_observer_; 1557 PowerManagerClientObserverForTesting* power_manager_observer_;
1545 #endif // defined(OS_CHROMEOS) 1558 #endif // defined(OS_CHROMEOS)
1546 1559
1560 std::map<std::string, JsonHandler> handler_map_;
1561 std::map<std::string, BrowserJsonHandler> browser_handler_map_;
1562
1547 // Used to wait on various browser sync events. 1563 // Used to wait on various browser sync events.
1548 scoped_ptr<ProfileSyncServiceHarness> sync_waiter_; 1564 scoped_ptr<ProfileSyncServiceHarness> sync_waiter_;
1549 1565
1550 content::NotificationRegistrar registrar_; 1566 content::NotificationRegistrar registrar_;
1551 1567
1552 // Used to enumerate browser profiles. 1568 // Used to enumerate browser profiles.
1553 scoped_refptr<ImporterList> importer_list_; 1569 scoped_refptr<ImporterList> importer_list_;
1554 1570
1555 // The stored data for the ImportSettings operation. 1571 // The stored data for the ImportSettings operation.
1556 ImportSettingsData import_settings_data_; 1572 ImportSettingsData import_settings_data_;
1557 1573
1558 // The automation event observer queue. It is lazily created when an observer 1574 // The automation event observer queue. It is lazily created when an observer
1559 // is added to avoid overhead when not needed. 1575 // is added to avoid overhead when not needed.
1560 scoped_ptr<AutomationEventQueue> automation_event_queue_; 1576 scoped_ptr<AutomationEventQueue> automation_event_queue_;
1561 1577
1562 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); 1578 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider);
1563 }; 1579 };
1564 1580
1565 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 1581 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/automation/testing_automation_provider.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698