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

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

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 #include "chrome/test/testing_profile.h" 5 #include "chrome/test/testing_profile.h"
6 6
7 #include "build/build_config.h" 7 #include "build/build_config.h"
8 8
9 #include "base/base_paths.h" 9 #include "base/base_paths.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
11 #include "base/file_util.h" 11 #include "base/file_util.h"
12 #include "base/message_loop_proxy.h" 12 #include "base/message_loop_proxy.h"
13 #include "base/path_service.h" 13 #include "base/path_service.h"
14 #include "base/string_number_conversions.h" 14 #include "base/string_number_conversions.h"
15 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 15 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
16 #include "chrome/browser/bookmarks/bookmark_model.h" 16 #include "chrome/browser/bookmarks/bookmark_model.h"
17 #include "chrome/browser/browser_thread.h" 17 #include "chrome/browser/browser_thread.h"
18 #include "chrome/browser/content_settings/host_content_settings_map.h" 18 #include "chrome/browser/content_settings/host_content_settings_map.h"
19 #include "chrome/browser/custom_handlers/protocol_handler_registry.h"
19 #include "chrome/browser/dom_ui/ntp_resource_cache.h" 20 #include "chrome/browser/dom_ui/ntp_resource_cache.h"
20 #include "chrome/browser/extensions/extension_service.h" 21 #include "chrome/browser/extensions/extension_service.h"
21 #include "chrome/browser/extensions/extension_pref_value_map.h" 22 #include "chrome/browser/extensions/extension_pref_value_map.h"
22 #include "chrome/browser/favicon_service.h" 23 #include "chrome/browser/favicon_service.h"
23 #include "chrome/browser/geolocation/geolocation_content_settings_map.h" 24 #include "chrome/browser/geolocation/geolocation_content_settings_map.h"
24 #include "chrome/browser/geolocation/geolocation_permission_context.h" 25 #include "chrome/browser/geolocation/geolocation_permission_context.h"
25 #include "chrome/browser/history/history.h" 26 #include "chrome/browser/history/history.h"
26 #include "chrome/browser/history/history_backend.h" 27 #include "chrome/browser/history/history_backend.h"
27 #include "chrome/browser/history/top_sites.h" 28 #include "chrome/browser/history/top_sites.h"
28 #include "chrome/browser/in_process_webkit/webkit_context.h" 29 #include "chrome/browser/in_process_webkit/webkit_context.h"
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
269 history_service_->history_backend_->expirer_.bookmark_service_ = 270 history_service_->history_backend_->expirer_.bookmark_service_ =
270 bookmark_bar_model_.get(); 271 bookmark_bar_model_.get();
271 } 272 }
272 bookmark_bar_model_->Load(); 273 bookmark_bar_model_->Load();
273 } 274 }
274 275
275 void TestingProfile::CreateAutocompleteClassifier() { 276 void TestingProfile::CreateAutocompleteClassifier() {
276 autocomplete_classifier_.reset(new AutocompleteClassifier(this)); 277 autocomplete_classifier_.reset(new AutocompleteClassifier(this));
277 } 278 }
278 279
280 void TestingProfile::CreateProtocolHandlerRegistry() {
281 protocol_handler_registry_ = new ProtocolHandlerRegistry(this);
282 }
283
279 void TestingProfile::CreateWebDataService(bool delete_file) { 284 void TestingProfile::CreateWebDataService(bool delete_file) {
280 if (web_data_service_.get()) 285 if (web_data_service_.get())
281 web_data_service_->Shutdown(); 286 web_data_service_->Shutdown();
282 287
283 if (delete_file) { 288 if (delete_file) {
284 FilePath path = GetPath(); 289 FilePath path = GetPath();
285 path = path.Append(chrome::kWebDataFilename); 290 path = path.Append(chrome::kWebDataFilename);
286 file_util::Delete(path, false); 291 file_util::Delete(path, false);
287 } 292 }
288 293
(...skipping 235 matching lines...) Expand 10 before | Expand all | Expand 10 after
524 } 529 }
525 return profile_sync_service_.get(); 530 return profile_sync_service_.get();
526 } 531 }
527 532
528 void TestingProfile::DestroyWebDataService() { 533 void TestingProfile::DestroyWebDataService() {
529 if (!web_data_service_.get()) 534 if (!web_data_service_.get())
530 return; 535 return;
531 536
532 web_data_service_->Shutdown(); 537 web_data_service_->Shutdown();
533 } 538 }
OLDNEW
« chrome/renderer/render_view.cc ('K') | « chrome/test/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698