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

Side by Side Diff: chrome/test/base/testing_profile.h

Issue 815983002: Topsites become keyedService based. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fix Created 6 years 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
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_TEST_BASE_TESTING_PROFILE_H_ 5 #ifndef CHROME_TEST_BASE_TESTING_PROFILE_H_
6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_ 6 #define CHROME_TEST_BASE_TESTING_PROFILE_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/files/scoped_temp_dir.h" 10 #include "base/files/scoped_temp_dir.h"
11 #include "base/memory/ref_counted.h" 11 #include "base/memory/ref_counted.h"
12 #include "base/memory/scoped_ptr.h" 12 #include "base/memory/scoped_ptr.h"
13 #include "chrome/browser/profiles/profile.h" 13 #include "chrome/browser/profiles/profile.h"
14 #include "components/domain_reliability/clear_mode.h" 14 #include "components/domain_reliability/clear_mode.h"
15 #include "components/keyed_service/content/browser_context_keyed_service_factory .h" 15 #include "components/keyed_service/content/browser_context_keyed_service_factory .h"
16 16
17 namespace content { 17 namespace content {
18 class MockResourceContext; 18 class MockResourceContext;
19 class SSLHostStateDelegate; 19 class SSLHostStateDelegate;
20 class ZoomLevelDelegate; 20 class ZoomLevelDelegate;
21 } 21 }
22 22
23 namespace history { 23 namespace history {
24 class TopSites; 24 class TopSitesProvider;
25 } 25 }
26 26
27 namespace net { 27 namespace net {
28 class CookieMonster; 28 class CookieMonster;
29 class URLRequestContextGetter; 29 class URLRequestContextGetter;
30 } 30 }
31 31
32 namespace policy { 32 namespace policy {
33 class PolicyService; 33 class PolicyService;
34 class ProfilePolicyConnector; 34 class ProfilePolicyConnector;
(...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 // Shuts down and nulls out the reference to HistoryService. 178 // Shuts down and nulls out the reference to HistoryService.
179 void DestroyHistoryService(); 179 void DestroyHistoryService();
180 180
181 // Creates TopSites. This returns immediately, and top sites may not be 181 // Creates TopSites. This returns immediately, and top sites may not be
182 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished 182 // loaded. Use BlockUntilTopSitesLoaded to ensure TopSites has finished
183 // loading. 183 // loading.
184 void CreateTopSites(); 184 void CreateTopSites();
185 185
186 // Allows to set a test implementation |top_sites|. Testing profile owns 186 // Allows to set a test implementation |top_sites|. Testing profile owns
187 // the reference and is responsible for releasing memory. 187 // the reference and is responsible for releasing memory.
188 void SetTopSites(history::TopSites* top_sites); 188 void SetTopSites(history::TopSitesProvider* top_sites);
189 189
190 // Shuts down and nulls out the reference to TopSites. 190 // Shuts down and nulls out the reference to TopSites.
191 void DestroyTopSites(); 191 void DestroyTopSites();
192 192
193 // Creates the BookmarkBarModel. If not invoked the bookmark bar model is 193 // Creates the BookmarkBarModel. If not invoked the bookmark bar model is
194 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then 194 // NULL. If |delete_file| is true, the bookmarks file is deleted first, then
195 // the model is created. As TestingProfile deletes the directory containing 195 // the model is created. As TestingProfile deletes the directory containing
196 // the files used by HistoryService, the boolean only matters if you're 196 // the files used by HistoryService, the boolean only matters if you're
197 // recreating the BookmarkModel. 197 // recreating the BookmarkModel.
198 // 198 //
(...skipping 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
274 ExtensionSpecialStoragePolicy* extension_special_storage_policy); 274 ExtensionSpecialStoragePolicy* extension_special_storage_policy);
275 #endif 275 #endif
276 ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override; 276 ExtensionSpecialStoragePolicy* GetExtensionSpecialStoragePolicy() override;
277 // TODO(ajwong): Remove this API in favor of directly retrieving the 277 // TODO(ajwong): Remove this API in favor of directly retrieving the
278 // CookieStore from the StoragePartition after ExtensionURLRequestContext 278 // CookieStore from the StoragePartition after ExtensionURLRequestContext
279 // has been removed. 279 // has been removed.
280 net::CookieMonster* GetCookieMonster(); 280 net::CookieMonster* GetCookieMonster();
281 281
282 PrefService* GetPrefs() override; 282 PrefService* GetPrefs() override;
283 283
284 history::TopSites* GetTopSites() override; 284 history::TopSitesProvider* GetTopSites();
285 history::TopSites* GetTopSitesWithoutCreating() override; 285 history::TopSitesProvider* GetTopSitesWithoutCreating();
286 286
287 net::URLRequestContextGetter* GetMediaRequestContext() override; 287 net::URLRequestContextGetter* GetMediaRequestContext() override;
288 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess( 288 net::URLRequestContextGetter* GetMediaRequestContextForRenderProcess(
289 int renderer_child_id) override; 289 int renderer_child_id) override;
290 net::URLRequestContextGetter* GetRequestContextForExtensions() override; 290 net::URLRequestContextGetter* GetRequestContextForExtensions() override;
291 net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition( 291 net::URLRequestContextGetter* GetMediaRequestContextForStoragePartition(
292 const base::FilePath& partition_path, 292 const base::FilePath& partition_path,
293 bool in_memory) override; 293 bool in_memory) override;
294 net::URLRequestContextGetter* CreateRequestContextForStoragePartition( 294 net::URLRequestContextGetter* CreateRequestContextForStoragePartition(
295 const base::FilePath& partition_path, 295 const base::FilePath& partition_path,
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after
376 bool guest_session_; 376 bool guest_session_;
377 377
378 std::string supervised_user_id_; 378 std::string supervised_user_id_;
379 379
380 // Did the last session exit cleanly? Default is true. 380 // Did the last session exit cleanly? Default is true.
381 bool last_session_exited_cleanly_; 381 bool last_session_exited_cleanly_;
382 382
383 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; 383 scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
384 384
385 base::FilePath last_selected_directory_; 385 base::FilePath last_selected_directory_;
386 scoped_refptr<history::TopSites> top_sites_; // For history and thumbnails. 386 scoped_refptr<history::TopSitesProvider>
387 top_sites_; // For history and thumbnails.
387 388
388 #if defined(ENABLE_EXTENSIONS) 389 #if defined(ENABLE_EXTENSIONS)
389 scoped_refptr<ExtensionSpecialStoragePolicy> 390 scoped_refptr<ExtensionSpecialStoragePolicy>
390 extension_special_storage_policy_; 391 extension_special_storage_policy_;
391 #endif 392 #endif
392 393
393 // The proxy prefs tracker. 394 // The proxy prefs tracker.
394 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_; 395 scoped_ptr<PrefProxyConfigTracker> pref_proxy_config_tracker_;
395 396
396 // We use a temporary directory to store testing profile data. In a multi- 397 // We use a temporary directory to store testing profile data. In a multi-
(...skipping 20 matching lines...) Expand all
417 418
418 // Weak pointer to a delegate for indicating that a profile was created. 419 // Weak pointer to a delegate for indicating that a profile was created.
419 Delegate* delegate_; 420 Delegate* delegate_;
420 421
421 std::string profile_name_; 422 std::string profile_name_;
422 423
423 scoped_ptr<policy::PolicyService> policy_service_; 424 scoped_ptr<policy::PolicyService> policy_service_;
424 }; 425 };
425 426
426 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_ 427 #endif // CHROME_TEST_BASE_TESTING_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698