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

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

Issue 6732040: PyAuto automation hooks: blocking wifi connect, disconnect, and network scan. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Changes per comments. Created 9 years, 9 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
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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_AUTOMATION_PROVIDER_OBSERVERS_H_ 5 #ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 6 #define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
7 #pragma once 7 #pragma once
8 8
9 #include <deque> 9 #include <deque>
10 #include <map> 10 #include <map>
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 }; 94 };
95 95
96 #if defined(OS_CHROMEOS) 96 #if defined(OS_CHROMEOS)
97 // Watches for NetworkManager events. Because NetworkLibrary loads 97 // Watches for NetworkManager events. Because NetworkLibrary loads
98 // asynchronously, this is used to make sure it is done before tests are run. 98 // asynchronously, this is used to make sure it is done before tests are run.
99 class NetworkManagerInitObserver 99 class NetworkManagerInitObserver
100 : public chromeos::NetworkLibrary::NetworkManagerObserver { 100 : public chromeos::NetworkLibrary::NetworkManagerObserver {
101 public: 101 public:
102 explicit NetworkManagerInitObserver(AutomationProvider* automation); 102 explicit NetworkManagerInitObserver(AutomationProvider* automation);
103 virtual ~NetworkManagerInitObserver(); 103 virtual ~NetworkManagerInitObserver();
104 virtual bool Init();
104 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* obj); 105 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* obj);
105 106
106 private: 107 private:
107 base::WeakPtr<AutomationProvider> automation_; 108 base::WeakPtr<AutomationProvider> automation_;
108 109
109 DISALLOW_COPY_AND_ASSIGN(NetworkManagerInitObserver); 110 DISALLOW_COPY_AND_ASSIGN(NetworkManagerInitObserver);
110 }; 111 };
111 #endif // defined(OS_CHROMEOS) 112 #endif // defined(OS_CHROMEOS)
112 113
113 // Watches for NewTabUI page loads for performance timing purposes. 114 // Watches for NewTabUI page loads for performance timing purposes.
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after
695 const NotificationDetails& details); 696 const NotificationDetails& details);
696 697
697 private: 698 private:
698 NotificationRegistrar registrar_; 699 NotificationRegistrar registrar_;
699 AutomationProvider* automation_; 700 AutomationProvider* automation_;
700 IPC::Message* reply_message_; 701 IPC::Message* reply_message_;
701 bool lock_screen_; 702 bool lock_screen_;
702 703
703 DISALLOW_COPY_AND_ASSIGN(ScreenLockUnlockObserver); 704 DISALLOW_COPY_AND_ASSIGN(ScreenLockUnlockObserver);
704 }; 705 };
706
707 class NetworkScanObserver
708 : public chromeos::NetworkLibrary::NetworkManagerObserver {
709 public:
710 NetworkScanObserver(AutomationProvider* automation,
711 IPC::Message* reply_message);
712
713 virtual ~NetworkScanObserver();
714
715 // NetworkLibrary::NetworkManagerObserver implementation.
716 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* obj);
717
718 private:
719 AutomationProvider* automation_;
720 IPC::Message* reply_message_;
721
722 DISALLOW_COPY_AND_ASSIGN(NetworkScanObserver);
723 };
724
725 // Waits for a connection success or failure for the specified
726 // network and returns the status to the automation provider.
727 class NetworkConnectObserver
728 : public chromeos::NetworkLibrary::NetworkManagerObserver {
729 public:
730 NetworkConnectObserver(AutomationProvider* automation,
731 IPC::Message* reply_message,
732 const std::string& service_path);
733
734 virtual ~NetworkConnectObserver();
735
736 // NetworkLibrary::NetworkManagerObserver implementation.
737 virtual void OnNetworkManagerChanged(chromeos::NetworkLibrary* obj);
738
739 private:
740 AutomationProvider* automation_;
741 IPC::Message* reply_message_;
742 std::string service_path_;
743
744 DISALLOW_COPY_AND_ASSIGN(NetworkConnectObserver);
745 };
705 #endif // defined(OS_CHROMEOS) 746 #endif // defined(OS_CHROMEOS)
706 747
707 // Waits for the bookmark model to load. 748 // Waits for the bookmark model to load.
708 class AutomationProviderBookmarkModelObserver : BookmarkModelObserver { 749 class AutomationProviderBookmarkModelObserver : BookmarkModelObserver {
709 public: 750 public:
710 AutomationProviderBookmarkModelObserver(AutomationProvider* provider, 751 AutomationProviderBookmarkModelObserver(AutomationProvider* provider,
711 IPC::Message* reply_message, 752 IPC::Message* reply_message,
712 BookmarkModel* model); 753 BookmarkModel* model);
713 virtual ~AutomationProviderBookmarkModelObserver(); 754 virtual ~AutomationProviderBookmarkModelObserver();
714 755
(...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after
1177 // Sends the |reply_message_| to |automation_| indicating we're done. 1218 // Sends the |reply_message_| to |automation_| indicating we're done.
1178 void RunOnUIThread(); 1219 void RunOnUIThread();
1179 1220
1180 base::WeakPtr<AutomationProvider> automation_; 1221 base::WeakPtr<AutomationProvider> automation_;
1181 scoped_ptr<IPC::Message> reply_message_; 1222 scoped_ptr<IPC::Message> reply_message_;
1182 1223
1183 DISALLOW_COPY_AND_ASSIGN(WaitForProcessLauncherThreadToGoIdleObserver); 1224 DISALLOW_COPY_AND_ASSIGN(WaitForProcessLauncherThreadToGoIdleObserver);
1184 }; 1225 };
1185 1226
1186 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_ 1227 #endif // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROVIDER_OBSERVERS_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698