summaryrefslogtreecommitdiffstats
path: root/chrome/browser/automation/automation_profile_impl.h
blob: c0f2592f2a3b34b89acc96116ff38883f9c07692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
// Copyright (c) 2006-2009 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef CHROME_BROWSER_AUTOMATION_AUTOMATION_PROFILE_IMPL_H_
#define CHROME_BROWSER_AUTOMATION_AUTOMATION_PROFILE_IMPL_H_

#include "chrome/browser/profile.h"
#include "net/url_request/url_request_context.h"

namespace net {
class CookieStore;
}

// Automation overrides for profile settings.
class AutomationProfileImpl : public Profile {
 public:
  AutomationProfileImpl() : original_profile_(NULL),
                            tab_handle_(0) {
  }

  void Initialize(Profile* original_profile,
                  IPC::Message::Sender* automation_client);

  void set_tab_handle(int tab_handle) {
    tab_handle_ = tab_handle;
  }
  int tab_handle() const {
    return tab_handle_;
  }

  // Profile implementation.
  virtual FilePath GetPath() {
    return original_profile_->GetPath();
  }
  virtual bool IsOffTheRecord() {
    return original_profile_->IsOffTheRecord();
  }
  virtual Profile* GetOffTheRecordProfile() {
    return original_profile_->GetOffTheRecordProfile();
  }
  virtual void DestroyOffTheRecordProfile() {
    return original_profile_->DestroyOffTheRecordProfile();
  }
  virtual Profile* GetOriginalProfile() {
    return original_profile_->GetOriginalProfile();
  }
  virtual VisitedLinkMaster* GetVisitedLinkMaster() {
    return original_profile_->GetVisitedLinkMaster();
  }
  virtual ExtensionsService* GetExtensionsService() {
    return original_profile_->GetExtensionsService();
  }
  virtual UserScriptMaster* GetUserScriptMaster() {
    return original_profile_->GetUserScriptMaster();
  }
  virtual ExtensionDevToolsManager* GetExtensionDevToolsManager() {
    return original_profile_->GetExtensionDevToolsManager();
  }
  virtual ExtensionProcessManager* GetExtensionProcessManager() {
    return original_profile_->GetExtensionProcessManager();
  }
  virtual ExtensionMessageService* GetExtensionMessageService() {
    return original_profile_->GetExtensionMessageService();
  }
  virtual SSLHostState* GetSSLHostState() {
    return original_profile_->GetSSLHostState();
  }
  virtual net::ForceTLSState* GetForceTLSState() {
    return original_profile_->GetForceTLSState();
  }
  virtual FaviconService* GetFaviconService(ServiceAccessType access) {
    return original_profile_->GetFaviconService(access);
  }
  virtual HistoryService* GetHistoryService(ServiceAccessType access) {
    return original_profile_->GetHistoryService(access);
  }
  virtual WebDataService* GetWebDataService(ServiceAccessType access) {
    return original_profile_->GetWebDataService(access);
  }
  virtual PasswordStore* GetPasswordStore(ServiceAccessType access) {
    return original_profile_->GetPasswordStore(access);
  }
  virtual PrefService* GetPrefs() {
    return original_profile_->GetPrefs();
  }
  virtual TemplateURLModel* GetTemplateURLModel() {
    return original_profile_->GetTemplateURLModel();
  }
  virtual TemplateURLFetcher* GetTemplateURLFetcher() {
    return original_profile_->GetTemplateURLFetcher();
  }
  virtual DownloadManager* GetDownloadManager() {
    return original_profile_->GetDownloadManager();
  }
  virtual bool HasCreatedDownloadManager() const {
    return original_profile_->HasCreatedDownloadManager();
  }
  virtual void InitThemes() {
    return original_profile_->InitThemes();
  }
  virtual void SetTheme(Extension* extension) {
    return original_profile_->SetTheme(extension);
  }
  virtual void SetNativeTheme() {
    return original_profile_->SetNativeTheme();
  }
  virtual void ClearTheme() {
    return original_profile_->ClearTheme();
  }
  virtual Extension* GetTheme() {
    return original_profile_->GetTheme();
  }
  virtual ThemeProvider* GetThemeProvider() {
    return original_profile_->GetThemeProvider();
  }
  virtual ThumbnailStore* GetThumbnailStore() {
    return original_profile_->GetThumbnailStore();
  }
  virtual URLRequestContext* GetRequestContext() {
    return alternate_reqeust_context_;
  }
  virtual URLRequestContext* GetRequestContextForMedia() {
    return original_profile_->GetRequestContextForMedia();
  }
  virtual URLRequestContext* GetRequestContextForExtensions() {
    return original_profile_->GetRequestContextForExtensions();
  }
  virtual net::SSLConfigService* GetSSLConfigService() {
    return original_profile_->GetSSLConfigService();
  }
  virtual Blacklist* GetBlacklist() {
    return original_profile_->GetBlacklist();
  }
  virtual SessionService* GetSessionService() {
    return original_profile_->GetSessionService();
  }
  virtual void ShutdownSessionService() {
    return original_profile_->ShutdownSessionService();
  }
  virtual bool HasSessionService() const {
    return original_profile_->HasSessionService();
  }
  virtual std::wstring GetName() {
    return original_profile_->GetName();
  }
  virtual void SetName(const std::wstring& name) {
    return original_profile_->SetName(name);
  }
  virtual std::wstring GetID() {
    return original_profile_->GetID();
  }
  virtual void SetID(const std::wstring& id) {
    return original_profile_->SetID(id);
  }
  virtual bool DidLastSessionExitCleanly() {
    return original_profile_->DidLastSessionExitCleanly();
  }
  virtual BookmarkModel* GetBookmarkModel() {
    return original_profile_->GetBookmarkModel();
  }

#ifdef CHROME_PERSONALIZATION
  virtual ProfileSyncService* GetProfileSyncService() {
    return original_profile_->GetProfileSyncService();
  }
#endif

  virtual bool IsSameProfile(Profile* profile) {
    return original_profile_->IsSameProfile(profile);
  }
  virtual base::Time GetStartTime() const {
    return original_profile_->GetStartTime();
  }
  virtual TabRestoreService* GetTabRestoreService() {
    return original_profile_->GetTabRestoreService();
  }
  virtual void ResetTabRestoreService() {
    return original_profile_->ResetTabRestoreService();
  }
  virtual void ReinitializeSpellChecker() {
    return original_profile_->ReinitializeSpellChecker();
  }
  virtual SpellChecker* GetSpellChecker() {
    return original_profile_->GetSpellChecker();
  }
  virtual WebKitContext* GetWebKitContext() {
    return original_profile_->GetWebKitContext();
  }
  virtual void MarkAsCleanShutdown() {
    return original_profile_->MarkAsCleanShutdown();
  }
  virtual void InitExtensions() {
    return original_profile_->InitExtensions();
  }
  virtual void InitWebResources() {
    return original_profile_->InitWebResources();
  }

 protected:
  Profile* original_profile_;
  scoped_ptr<net::CookieStore> alternate_cookie_store_;
  scoped_refptr<URLRequestContext> alternate_reqeust_context_;
  int tab_handle_;

 private:
  DISALLOW_COPY_AND_ASSIGN(AutomationProfileImpl);
};

#endif  // CHROME_BROWSER_AUTOMATION_AUTOMATION_PROFILE_IMPL_H_