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

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

Issue 6410115: Adds navigator.registerProtocolHandler. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: Responded to comments, prevents rph on privileged protocols. Created 9 years, 10 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_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 #pragma once 7 #pragma once
8 8
9 #include "base/ref_counted.h" 9 #include "base/ref_counted.h"
10 #include "base/scoped_ptr.h" 10 #include "base/scoped_ptr.h"
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 // recreating the BookmarkModel. 77 // recreating the BookmarkModel.
78 // 78 //
79 // NOTE: this does not block until the bookmarks are loaded. For that use 79 // NOTE: this does not block until the bookmarks are loaded. For that use
80 // BlockUntilBookmarkModelLoaded. 80 // BlockUntilBookmarkModelLoaded.
81 void CreateBookmarkModel(bool delete_file); 81 void CreateBookmarkModel(bool delete_file);
82 82
83 // Creates an AutocompleteClassifier. If not invoked the 83 // Creates an AutocompleteClassifier. If not invoked the
84 // AutocompleteClassifier is NULL. 84 // AutocompleteClassifier is NULL.
85 void CreateAutocompleteClassifier(); 85 void CreateAutocompleteClassifier();
86 86
87 // Creates a ProtocolHandlerRegistry. If not invoked the protocol handler
88 // registry is NULL.
89 void CreateProtocolHandlerRegistry();
90
87 // Creates the webdata service. If |delete_file| is true, the webdata file is 91 // Creates the webdata service. If |delete_file| is true, the webdata file is
88 // deleted first, then the WebDataService is created. As TestingProfile 92 // deleted first, then the WebDataService is created. As TestingProfile
89 // deletes the directory containing the files used by WebDataService, this 93 // deletes the directory containing the files used by WebDataService, this
90 // only matters if you're recreating the WebDataService. 94 // only matters if you're recreating the WebDataService.
91 void CreateWebDataService(bool delete_file); 95 void CreateWebDataService(bool delete_file);
92 96
93 // Blocks until the BookmarkModel finishes loaded. This is NOT invoked from 97 // Blocks until the BookmarkModel finishes loaded. This is NOT invoked from
94 // CreateBookmarkModel. 98 // CreateBookmarkModel.
95 void BlockUntilBookmarkModelLoaded(); 99 void BlockUntilBookmarkModelLoaded();
96 100
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after
259 virtual bool DidLastSessionExitCleanly() { 263 virtual bool DidLastSessionExitCleanly() {
260 return last_session_exited_cleanly_; 264 return last_session_exited_cleanly_;
261 } 265 }
262 virtual void MergeResourceString(int message_id, 266 virtual void MergeResourceString(int message_id,
263 std::wstring* output_string) {} 267 std::wstring* output_string) {}
264 virtual void MergeResourceInteger(int message_id, int* output_value) {} 268 virtual void MergeResourceInteger(int message_id, int* output_value) {}
265 virtual void MergeResourceBoolean(int message_id, bool* output_value) {} 269 virtual void MergeResourceBoolean(int message_id, bool* output_value) {}
266 virtual BookmarkModel* GetBookmarkModel() { 270 virtual BookmarkModel* GetBookmarkModel() {
267 return bookmark_bar_model_.get(); 271 return bookmark_bar_model_.get();
268 } 272 }
273 virtual ProtocolHandlerRegistry* GetProtocolHandlerRegistry() {
274 return protocol_handler_registry_.get();
275 }
269 virtual bool IsSameProfile(Profile *p) { return this == p; } 276 virtual bool IsSameProfile(Profile *p) { return this == p; }
270 virtual base::Time GetStartTime() const { return start_time_; } 277 virtual base::Time GetStartTime() const { return start_time_; }
271 virtual TabRestoreService* GetTabRestoreService() { return NULL; } 278 virtual TabRestoreService* GetTabRestoreService() { return NULL; }
272 virtual void ResetTabRestoreService() {} 279 virtual void ResetTabRestoreService() {}
273 virtual SpellCheckHost* GetSpellCheckHost() { return NULL; } 280 virtual SpellCheckHost* GetSpellCheckHost() { return NULL; }
274 virtual void ReinitializeSpellCheckHost(bool force) { } 281 virtual void ReinitializeSpellCheckHost(bool force) { }
275 virtual WebKitContext* GetWebKitContext(); 282 virtual WebKitContext* GetWebKitContext();
276 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; } 283 virtual WebKitContext* GetOffTheRecordWebKitContext() { return NULL; }
277 virtual void MarkAsCleanShutdown() {} 284 virtual void MarkAsCleanShutdown() {}
278 virtual void InitExtensions() {} 285 virtual void InitExtensions() {}
279 virtual void InitWebResources() {} 286 virtual void InitWebResources() {}
287 virtual void InitRegisteredProtocolHandlers() {}
280 virtual NTPResourceCache* GetNTPResourceCache(); 288 virtual NTPResourceCache* GetNTPResourceCache();
281 289
282 virtual DesktopNotificationService* GetDesktopNotificationService(); 290 virtual DesktopNotificationService* GetDesktopNotificationService();
283 virtual BackgroundContentsService* GetBackgroundContentsService() const { 291 virtual BackgroundContentsService* GetBackgroundContentsService() const {
284 return NULL; 292 return NULL;
285 } 293 }
286 virtual StatusTray* GetStatusTray() { 294 virtual StatusTray* GetStatusTray() {
287 return NULL; 295 return NULL;
288 } 296 }
289 virtual FilePath last_selected_directory() { 297 virtual FilePath last_selected_directory() {
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
342 350
343 // The favicon service. Only created if CreateFaviconService is invoked. 351 // The favicon service. Only created if CreateFaviconService is invoked.
344 scoped_refptr<FaviconService> favicon_service_; 352 scoped_refptr<FaviconService> favicon_service_;
345 353
346 // The history service. Only created if CreateHistoryService is invoked. 354 // The history service. Only created if CreateHistoryService is invoked.
347 scoped_refptr<HistoryService> history_service_; 355 scoped_refptr<HistoryService> history_service_;
348 356
349 // The BookmarkModel. Only created if CreateBookmarkModel is invoked. 357 // The BookmarkModel. Only created if CreateBookmarkModel is invoked.
350 scoped_ptr<BookmarkModel> bookmark_bar_model_; 358 scoped_ptr<BookmarkModel> bookmark_bar_model_;
351 359
360 // The ProtocolHandlerRegistry. Only created if CreateProtocolHandlerRegistry is invoked.
361 scoped_refptr<ProtocolHandlerRegistry> protocol_handler_registry_;
362
352 // The TokenService. Created by CreateTokenService. Filled with dummy data. 363 // The TokenService. Created by CreateTokenService. Filled with dummy data.
353 scoped_ptr<TokenService> token_service_; 364 scoped_ptr<TokenService> token_service_;
354 365
355 // The ProfileSyncService. Created by CreateProfileSyncService. 366 // The ProfileSyncService. Created by CreateProfileSyncService.
356 scoped_ptr<ProfileSyncService> profile_sync_service_; 367 scoped_ptr<ProfileSyncService> profile_sync_service_;
357 368
358 // The AutocompleteClassifier. Only created if CreateAutocompleteClassifier 369 // The AutocompleteClassifier. Only created if CreateAutocompleteClassifier
359 // is invoked. 370 // is invoked.
360 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_; 371 scoped_ptr<AutocompleteClassifier> autocomplete_classifier_;
361 372
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
440 451
441 virtual ProfileId GetRuntimeId() { 452 virtual ProfileId GetRuntimeId() {
442 return original_profile_->GetRuntimeId(); 453 return original_profile_->GetRuntimeId();
443 } 454 }
444 455
445 protected: 456 protected:
446 Profile* original_profile_; 457 Profile* original_profile_;
447 }; 458 };
448 459
449 #endif // CHROME_TEST_TESTING_PROFILE_H_ 460 #endif // CHROME_TEST_TESTING_PROFILE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698