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

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

Issue 10690151: Move implementation of BrowserList onto an inner, instantiatable class, BrowserListImpl. (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
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>
11 #include <vector> 11 #include <vector>
12 12
13 #include "base/basictypes.h" 13 #include "base/basictypes.h"
14 #include "base/compiler_specific.h" 14 #include "base/compiler_specific.h"
15 #include "base/memory/scoped_ptr.h" 15 #include "base/memory/scoped_ptr.h"
16 #include "chrome/browser/automation/automation_event_observers.h" 16 #include "chrome/browser/automation/automation_event_observers.h"
17 #include "chrome/browser/automation/automation_event_queue.h" 17 #include "chrome/browser/automation/automation_event_queue.h"
18 #include "chrome/browser/automation/automation_provider.h" 18 #include "chrome/browser/automation/automation_provider.h"
19 #include "chrome/browser/automation/automation_provider_json.h" 19 #include "chrome/browser/automation/automation_provider_json.h"
20 #include "chrome/browser/history/history.h" 20 #include "chrome/browser/history/history.h"
21 #include "chrome/browser/importer/importer_list_observer.h" 21 #include "chrome/browser/importer/importer_list_observer.h"
22 #include "chrome/browser/sync/profile_sync_service_harness.h" 22 #include "chrome/browser/sync/profile_sync_service_harness.h"
23 #include "chrome/browser/ui/browser_list.h" 23 #include "chrome/browser/ui/browser_list_observer.h"
24 #include "content/public/browser/notification_registrar.h" 24 #include "content/public/browser/notification_registrar.h"
25 #include "content/public/common/page_type.h" 25 #include "content/public/common/page_type.h"
26 #include "content/public/common/security_style.h" 26 #include "content/public/common/security_style.h"
27 #include "net/base/cert_status_flags.h" 27 #include "net/base/cert_status_flags.h"
28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h" 28 #include "third_party/WebKit/Source/WebKit/chromium/public/WebInputEvent.h"
29 29
30 #if defined(OS_CHROMEOS) 30 #if defined(OS_CHROMEOS)
31 // TODO(sque): move to a ChromeOS-specific class. See crosbug.com/22081. 31 // TODO(sque): move to a ChromeOS-specific class. See crosbug.com/22081.
32 class PowerManagerClientObserverForTesting; 32 class PowerManagerClientObserverForTesting;
33 #endif // defined(OS_CHROMEOS) 33 #endif // defined(OS_CHROMEOS)
(...skipping 14 matching lines...) Expand all
48 namespace gfx { 48 namespace gfx {
49 class Rect; 49 class Rect;
50 } 50 }
51 51
52 namespace webkit { 52 namespace webkit {
53 struct WebPluginInfo; 53 struct WebPluginInfo;
54 } 54 }
55 55
56 // This is an automation provider containing testing calls. 56 // This is an automation provider containing testing calls.
57 class TestingAutomationProvider : public AutomationProvider, 57 class TestingAutomationProvider : public AutomationProvider,
58 public BrowserList::Observer, 58 public chrome::BrowserListObserver,
59 public importer::ImporterListObserver, 59 public importer::ImporterListObserver,
60 public content::NotificationObserver { 60 public content::NotificationObserver {
61 public: 61 public:
62 explicit TestingAutomationProvider(Profile* profile); 62 explicit TestingAutomationProvider(Profile* profile);
63 63
64 virtual IPC::Channel::Mode GetChannelMode(bool use_named_interface); 64 virtual IPC::Channel::Mode GetChannelMode(bool use_named_interface);
65 65
66 // IPC::Listener: 66 // IPC::Listener:
67 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE; 67 virtual bool OnMessageReceived(const IPC::Message& msg) OVERRIDE;
68 virtual void OnChannelError() OVERRIDE; 68 virtual void OnChannelError() OVERRIDE;
69 69
70 private: 70 private:
71 // Storage for ImportSettings() to resume operations after a callback. 71 // Storage for ImportSettings() to resume operations after a callback.
72 struct ImportSettingsData { 72 struct ImportSettingsData {
73 string16 browser_name; 73 string16 browser_name;
74 int import_items; 74 int import_items;
75 bool first_run; 75 bool first_run;
76 Browser* browser; 76 Browser* browser;
77 IPC::Message* reply_message; 77 IPC::Message* reply_message;
78 }; 78 };
79 79
80 virtual ~TestingAutomationProvider(); 80 virtual ~TestingAutomationProvider();
81 81
82 // BrowserList::Observer: 82 // chrome::BrowserListObserver:
83 virtual void OnBrowserAdded(Browser* browser) OVERRIDE; 83 virtual void OnBrowserAdded(Browser* browser) OVERRIDE;
84 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE; 84 virtual void OnBrowserRemoved(Browser* browser) OVERRIDE;
85 85
86 // importer::ImporterListObserver: 86 // importer::ImporterListObserver:
87 virtual void OnSourceProfilesLoaded() OVERRIDE; 87 virtual void OnSourceProfilesLoaded() OVERRIDE;
88 88
89 // content::NotificationObserver: 89 // content::NotificationObserver:
90 virtual void Observe(int type, 90 virtual void Observe(int type,
91 const content::NotificationSource& source, 91 const content::NotificationSource& source,
92 const content::NotificationDetails& details) OVERRIDE; 92 const content::NotificationDetails& details) OVERRIDE;
(...skipping 1489 matching lines...) Expand 10 before | Expand all | Expand 10 after
1582 ImportSettingsData import_settings_data_; 1582 ImportSettingsData import_settings_data_;
1583 1583
1584 // The automation event observer queue. It is lazily created when an observer 1584 // The automation event observer queue. It is lazily created when an observer
1585 // is added to avoid overhead when not needed. 1585 // is added to avoid overhead when not needed.
1586 scoped_ptr<AutomationEventQueue> automation_event_queue_; 1586 scoped_ptr<AutomationEventQueue> automation_event_queue_;
1587 1587
1588 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider); 1588 DISALLOW_COPY_AND_ASSIGN(TestingAutomationProvider);
1589 }; 1589 };
1590 1590
1591 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_ 1591 #endif // CHROME_BROWSER_AUTOMATION_TESTING_AUTOMATION_PROVIDER_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/chrome_browser_main.cc » ('j') | chrome/browser/ui/browser_list_observer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698