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

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

Issue 10703040: Revert 144610 (speculative; possibly caused http://crbug.com/135059) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 5 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 228 matching lines...) Expand 10 before | Expand all | Expand 10 after
239 IPC::Message* reply_message); 239 IPC::Message* reply_message);
240 240
241 void GoForwardBlockUntilNavigationsComplete(int handle, 241 void GoForwardBlockUntilNavigationsComplete(int handle,
242 int number_of_navigations, 242 int number_of_navigations,
243 IPC::Message* reply_message); 243 IPC::Message* reply_message);
244 244
245 void SetShelfVisibility(int handle, bool visible); 245 void SetShelfVisibility(int handle, bool visible);
246 246
247 // Generic pattern for pyautolib 247 // Generic pattern for pyautolib
248 // Uses the JSON interface for input/output. 248 // Uses the JSON interface for input/output.
249 void SendJSONRequestWithBrowserHandle(int handle, 249 void SendJSONRequest(int handle,
250 const std::string& json_request,
251 IPC::Message* reply_message);
252 void SendJSONRequestWithBrowserIndex(int index,
253 const std::string& json_request,
254 IPC::Message* reply_message);
255 void SendJSONRequest(Browser* browser,
256 const std::string& json_request, 250 const std::string& json_request,
257 IPC::Message* reply_message); 251 IPC::Message* reply_message);
258 252
259 // Method ptr for json handlers. 253 // Method ptr for json handlers.
260 // Uses the JSON interface for input/output. 254 // Uses the JSON interface for input/output.
261 typedef void (TestingAutomationProvider::*JsonHandler)(base::DictionaryValue*, 255 typedef void (TestingAutomationProvider::*JsonHandler)(base::DictionaryValue*,
262 IPC::Message*); 256 IPC::Message*);
263 257
264 // Method ptr for json handlers that take a browser argument. 258 // Method ptr for json handlers that take a browser argument.
265 // Uses the JSON interface for input/output. 259 // Uses the JSON interface for input/output.
266 typedef void (TestingAutomationProvider::*BrowserJsonHandler)( 260 typedef void (TestingAutomationProvider::*BrowserJsonHandler)(
267 Browser* browser, 261 Browser* browser,
268 base::DictionaryValue*, 262 base::DictionaryValue*,
269 IPC::Message*); 263 IPC::Message*);
270 264
271 // JSON interface helper functions.
272 static scoped_ptr<DictionaryValue> ParseJSONRequestCommand(
273 const std::string& json_request,
274 std::string* command,
275 std::string* error);
276 void BuildJSONHandlerMaps();
277
278 // Set window dimensions. 265 // Set window dimensions.
279 // Uses the JSON interface for input/output. 266 // Uses the JSON interface for input/output.
280 void SetWindowDimensions(Browser* browser, 267 void SetWindowDimensions(Browser* browser,
281 base::DictionaryValue* args, 268 base::DictionaryValue* args,
282 IPC::Message* reply_message); 269 IPC::Message* reply_message);
283 270
284 // Get info about infobars in the given WebContents object. 271 // Get info about infobars in the given WebContents object.
285 // This includes info about the type of infobars, the message text, 272 // This includes info about the type of infobars, the message text,
286 // buttons, etc. 273 // buttons, etc.
287 // Caller owns the returned object. 274 // Caller owns the returned object.
(...skipping 1273 matching lines...) Expand 10 before | Expand all | Expand 10 after
1561 1548
1562 // Selects the given |tab| if not selected already. 1549 // Selects the given |tab| if not selected already.
1563 void EnsureTabSelected(Browser* browser, content::WebContents* tab); 1550 void EnsureTabSelected(Browser* browser, content::WebContents* tab);
1564 1551
1565 #if defined(OS_CHROMEOS) 1552 #if defined(OS_CHROMEOS)
1566 // Avoid scoped ptr here to avoid having to define it completely in the 1553 // Avoid scoped ptr here to avoid having to define it completely in the
1567 // non-ChromeOS code. 1554 // non-ChromeOS code.
1568 PowerManagerClientObserverForTesting* power_manager_observer_; 1555 PowerManagerClientObserverForTesting* power_manager_observer_;
1569 #endif // defined(OS_CHROMEOS) 1556 #endif // defined(OS_CHROMEOS)
1570 1557
1571 std::map<std::string, JsonHandler> handler_map_;
1572 std::map<std::string, BrowserJsonHandler> browser_handler_map_;
1573
1574 // Used to wait on various browser sync events. 1558 // Used to wait on various browser sync events.
1575 scoped_ptr<ProfileSyncServiceHarness> sync_waiter_; 1559 scoped_ptr<ProfileSyncServiceHarness> sync_waiter_;
1576 1560
1577 content::NotificationRegistrar registrar_; 1561 content::NotificationRegistrar registrar_;
1578 1562
1579 // Used to enumerate browser profiles. 1563 // Used to enumerate browser profiles.
1580 scoped_refptr<ImporterList> importer_list_; 1564 scoped_refptr<ImporterList> importer_list_;
1581 1565
1582 // The stored data for the ImportSettings operation. 1566 // The stored data for the ImportSettings operation.
1583 ImportSettingsData import_settings_data_; 1567 ImportSettingsData import_settings_data_;
1584 1568
1585 // The automation event observer queue. It is lazily created when an observer 1569 // The automation event observer queue. It is lazily created when an observer
1586 // is added to avoid overhead when not needed. 1570 // is added to avoid overhead when not needed.
1587 scoped_ptr<AutomationEventQueue> automation_event_queue_; 1571 scoped_ptr<AutomationEventQueue> automation_event_queue_;
1588 1572
1589 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); 1573 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider);
1590 }; 1574 };
1591 1575
1592 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 1576 #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