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

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

Issue 2842043: Add a default content setting to the notifications service. (Closed)
Patch Set: '' Created 10 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
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_TEST_TESTING_PROFILE_H_ 5 #ifndef CHROME_TEST_TESTING_PROFILE_H_
6 #define CHROME_TEST_TESTING_PROFILE_H_ 6 #define CHROME_TEST_TESTING_PROFILE_H_
7 7
8 #include "base/base_paths.h" 8 #include "base/base_paths.h"
9 #include "base/file_util.h" 9 #include "base/file_util.h"
10 #include "base/path_service.h" 10 #include "base/path_service.h"
11 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 11 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
12 #include "chrome/browser/bookmarks/bookmark_model.h" 12 #include "chrome/browser/bookmarks/bookmark_model.h"
13 #include "chrome/browser/browser_prefs.h" 13 #include "chrome/browser/browser_prefs.h"
14 #include "chrome/browser/browser_theme_provider.h" 14 #include "chrome/browser/browser_theme_provider.h"
15 #include "chrome/browser/chrome_thread.h" 15 #include "chrome/browser/chrome_thread.h"
16 #include "chrome/browser/favicon_service.h" 16 #include "chrome/browser/favicon_service.h"
17 #include "chrome/browser/find_bar_state.h" 17 #include "chrome/browser/find_bar_state.h"
18 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 18 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
19 #include "chrome/browser/geolocation/geolocation_permission_context.h" 19 #include "chrome/browser/geolocation/geolocation_permission_context.h"
20 #include "chrome/browser/host_content_settings_map.h" 20 #include "chrome/browser/host_content_settings_map.h"
21 #include "chrome/browser/history/history.h" 21 #include "chrome/browser/history/history.h"
22 #include "chrome/browser/in_process_webkit/webkit_context.h" 22 #include "chrome/browser/in_process_webkit/webkit_context.h"
23 #include "chrome/browser/notifications/desktop_notification_service.h"
23 #include "chrome/browser/pref_service.h" 24 #include "chrome/browser/pref_service.h"
24 #include "chrome/browser/pref_value_store.h" 25 #include "chrome/browser/pref_value_store.h"
25 #include "chrome/browser/profile.h" 26 #include "chrome/browser/profile.h"
26 #include "chrome/browser/search_engines/template_url_model.h" 27 #include "chrome/browser/search_engines/template_url_model.h"
27 #include "chrome/common/json_pref_store.h" 28 #include "chrome/common/json_pref_store.h"
28 #include "chrome/common/net/url_request_context_getter.h" 29 #include "chrome/common/net/url_request_context_getter.h"
29 #include "net/base/cookie_monster.h" 30 #include "net/base/cookie_monster.h"
30 31
31 class ProfileSyncService; 32 class ProfileSyncService;
32 class SessionService; 33 class SessionService;
(...skipping 224 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 if (webkit_context_ == NULL) 258 if (webkit_context_ == NULL)
258 webkit_context_ = new WebKitContext(this); 259 webkit_context_ = new WebKitContext(this);
259 return webkit_context_; 260 return webkit_context_;
260 } 261 }
261 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; } 262 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; }
262 virtual void MarkAsCleanShutdown() {} 263 virtual void MarkAsCleanShutdown() {}
263 virtual void InitExtensions() {} 264 virtual void InitExtensions() {}
264 virtual void InitWebResources() {} 265 virtual void InitWebResources() {}
265 virtual NTPResourceCache* GetNTPResourceCache(); 266 virtual NTPResourceCache* GetNTPResourceCache();
266 virtual DesktopNotificationService* GetDesktopNotificationService() { 267 virtual DesktopNotificationService* GetDesktopNotificationService() {
267 return NULL; 268 DCHECK(ChromeThread::CurrentlyOn(ChromeThread::UI));
dhollowa 2010/07/03 02:12:01 nit: two space indent.
Nico 2010/07/03 02:18:29 Done.
269 if (!desktop_notification_service_.get()) {
270 desktop_notification_service_.reset(new DesktopNotificationService(
271 this, NULL));
272 }
273 return desktop_notification_service_.get();
268 } 274 }
269 virtual BackgroundContentsService* GetBackgroundContentsService() { 275 virtual BackgroundContentsService* GetBackgroundContentsService() {
270 return NULL; 276 return NULL;
271 } 277 }
272 virtual FilePath last_selected_directory() { 278 virtual FilePath last_selected_directory() {
273 return last_selected_directory_; 279 return last_selected_directory_;
274 } 280 }
275 virtual void set_last_selected_directory(const FilePath& path) { 281 virtual void set_last_selected_directory(const FilePath& path) {
276 last_selected_directory_ = path; 282 last_selected_directory_ = path;
277 } 283 }
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
356 // Should be used only on the file thread. 362 // Should be used only on the file thread.
357 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_; 363 scoped_refptr<webkit_database::DatabaseTracker> db_tracker_;
358 364
359 // WebKitContext, lazily initialized by GetWebKitContext(). 365 // WebKitContext, lazily initialized by GetWebKitContext().
360 scoped_refptr<WebKitContext> webkit_context_; 366 scoped_refptr<WebKitContext> webkit_context_;
361 367
362 scoped_refptr<HostContentSettingsMap> host_content_settings_map_; 368 scoped_refptr<HostContentSettingsMap> host_content_settings_map_;
363 scoped_refptr<GeolocationContentSettingsMap> 369 scoped_refptr<GeolocationContentSettingsMap>
364 geolocation_content_settings_map_; 370 geolocation_content_settings_map_;
365 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_; 371 scoped_refptr<GeolocationPermissionContext> geolocation_permission_context_;
372 scoped_ptr<DesktopNotificationService> desktop_notification_service_;
366 373
367 // Find bar state. Created lazily by GetFindBarState(). 374 // Find bar state. Created lazily by GetFindBarState().
368 scoped_ptr<FindBarState> find_bar_state_; 375 scoped_ptr<FindBarState> find_bar_state_;
369 376
370 FilePath last_selected_directory_; 377 FilePath last_selected_directory_;
371 }; 378 };
372 379
373 // A profile that derives from another profile. This does not actually 380 // A profile that derives from another profile. This does not actually
374 // override anything except the GetRuntimeId() in order to test sharing of 381 // override anything except the GetRuntimeId() in order to test sharing of
375 // site information. 382 // site information.
376 class DerivedTestingProfile : public TestingProfile { 383 class DerivedTestingProfile : public TestingProfile {
377 public: 384 public:
378 explicit DerivedTestingProfile(Profile* profile) 385 explicit DerivedTestingProfile(Profile* profile)
379 : original_profile_(profile) {} 386 : original_profile_(profile) {}
380 387
381 virtual ProfileId GetRuntimeId() { 388 virtual ProfileId GetRuntimeId() {
382 return original_profile_->GetRuntimeId(); 389 return original_profile_->GetRuntimeId();
383 } 390 }
384 391
385 protected: 392 protected:
386 Profile* original_profile_; 393 Profile* original_profile_;
387 }; 394 };
388 395
389 #endif // CHROME_TEST_TESTING_PROFILE_H_ 396 #endif // CHROME_TEST_TESTING_PROFILE_H_
OLDNEW
« chrome/browser/notifications/notifications_prefs_cache.h ('K') | « chrome/chrome_tests.gypi ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698