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

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

Issue 4096004: PyAuto hooks for Sync in TestingAutomationProvider (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase; Addressing final review comment. Created 10 years, 1 month 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) 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 #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 "base/basictypes.h" 9 #include "base/basictypes.h"
10 #include "base/scoped_ptr.h"
10 #include "chrome/browser/automation/automation_provider.h" 11 #include "chrome/browser/automation/automation_provider.h"
11 #include "chrome/browser/browser_list.h" 12 #include "chrome/browser/browser_list.h"
12 #include "chrome/browser/history/history.h" 13 #include "chrome/browser/history/history.h"
14 #include "chrome/browser/sync/profile_sync_service_harness.h"
13 #include "chrome/common/notification_registrar.h" 15 #include "chrome/common/notification_registrar.h"
14 16
15 class DictionaryValue; 17 class DictionaryValue;
16 class TemplateURLModel; 18 class TemplateURLModel;
17 19
18 // This is an automation provider containing testing calls. 20 // This is an automation provider containing testing calls.
19 class TestingAutomationProvider : public AutomationProvider, 21 class TestingAutomationProvider : public AutomationProvider,
20 public BrowserList::Observer, 22 public BrowserList::Observer,
21 public NotificationObserver { 23 public NotificationObserver {
22 public: 24 public:
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after
605 void GetAutoFillProfile(Browser* browser, 607 void GetAutoFillProfile(Browser* browser,
606 DictionaryValue* args, 608 DictionaryValue* args,
607 IPC::Message* reply_message); 609 IPC::Message* reply_message);
608 610
609 // Fill in an AutoFillProfile with the given profile information. 611 // Fill in an AutoFillProfile with the given profile information.
610 // Uses the JSON interface for input/output. 612 // Uses the JSON interface for input/output.
611 void FillAutoFillProfile(Browser* browser, 613 void FillAutoFillProfile(Browser* browser,
612 DictionaryValue* args, 614 DictionaryValue* args,
613 IPC::Message* reply_message); 615 IPC::Message* reply_message);
614 616
617 // Signs in to sync using the given username and password.
618 // Uses the JSON interface for input/output.
619 void SignInToSync(Browser* browser,
620 DictionaryValue* args,
621 IPC::Message* reply_message);
622
623 // Returns info about sync.
624 // Uses the JSON interface for input/output.
625 void GetSyncInfo(Browser* browser,
626 DictionaryValue* args,
627 IPC::Message* reply_message);
628
629 // Waits for the ongoing sync cycle to complete.
630 // Uses the JSON interface for input/output.
631 void AwaitSyncCycleCompletion(Browser* browser,
632 DictionaryValue* args,
633 IPC::Message* reply_message);
634
635 // Enables sync for one or more sync datatypes.
636 // Uses the JSON interface for input/output.
637 void EnableSyncForDatatypes(Browser* browser,
638 DictionaryValue* args,
639 IPC::Message* reply_message);
640
641 // Disables sync for one or more sync datatypes.
642 // Uses the JSON interface for input/output.
643 void DisableSyncForDatatypes(Browser* browser,
644 DictionaryValue* args,
645 IPC::Message* reply_message);
646
615 // Translate DictionaryValues of autofill profiles and credit cards to the 647 // Translate DictionaryValues of autofill profiles and credit cards to the
616 // data structure used in the browser. 648 // data structure used in the browser.
617 // Args: 649 // Args:
618 // profiles/cards: the ListValue of profiles/credit cards to translate. 650 // profiles/cards: the ListValue of profiles/credit cards to translate.
619 // error_message: a pointer to the return string in case of error. 651 // error_message: a pointer to the return string in case of error.
620 static std::vector<AutoFillProfile> GetAutoFillProfilesFromList( 652 static std::vector<AutoFillProfile> GetAutoFillProfilesFromList(
621 const ListValue& profiles, std::string* error_message); 653 const ListValue& profiles, std::string* error_message);
622 static std::vector<CreditCard> GetCreditCardsFromList( 654 static std::vector<CreditCard> GetCreditCardsFromList(
623 const ListValue& cards, std::string* error_message); 655 const ListValue& cards, std::string* error_message);
624 656
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 727
696 #if defined(TOOLKIT_VIEWS) 728 #if defined(TOOLKIT_VIEWS)
697 // Keep track of whether a popup menu has been opened since the last time 729 // Keep track of whether a popup menu has been opened since the last time
698 // that StartTrackingPopupMenus has been called. 730 // that StartTrackingPopupMenus has been called.
699 bool popup_menu_opened_; 731 bool popup_menu_opened_;
700 732
701 // A temporary object that receives a notification when a popup menu opens. 733 // A temporary object that receives a notification when a popup menu opens.
702 PopupMenuWaiter* popup_menu_waiter_; 734 PopupMenuWaiter* popup_menu_waiter_;
703 #endif // defined(TOOLKIT_VIEWS) 735 #endif // defined(TOOLKIT_VIEWS)
704 736
737 // Used to wait on various browser sync events.
738 scoped_ptr<ProfileSyncServiceHarness> sync_waiter_;
739
705 // Handle for an in-process redirect query. We expect only one redirect query 740 // Handle for an in-process redirect query. We expect only one redirect query
706 // at a time (we should have only one caller, and it will block while waiting 741 // at a time (we should have only one caller, and it will block while waiting
707 // for the results) so there is only one handle. When non-0, indicates a 742 // for the results) so there is only one handle. When non-0, indicates a
708 // query in progress. 743 // query in progress.
709 HistoryService::Handle redirect_query_; 744 HistoryService::Handle redirect_query_;
710 745
711 NotificationRegistrar registrar_; 746 NotificationRegistrar registrar_;
712 747
713 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); 748 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider);
714 }; 749 };
715 750
716 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 751 #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