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

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

Issue 12952005: Delay bookmarks load while the profile is loading. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix testing_profile.h Created 7 years, 8 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) 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 #include "chrome/test/base/testing_profile.h" 5 #include "chrome/test/base/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/deferred_sequenced_task_runner.h"
11 #include "base/file_util.h" 12 #include "base/file_util.h"
12 #include "base/message_loop_proxy.h" 13 #include "base/message_loop_proxy.h"
13 #include "base/path_service.h" 14 #include "base/path_service.h"
14 #include "base/prefs/testing_pref_store.h" 15 #include "base/prefs/testing_pref_store.h"
15 #include "base/run_loop.h" 16 #include "base/run_loop.h"
16 #include "base/strings/string_number_conversions.h" 17 #include "base/strings/string_number_conversions.h"
17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 18 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
18 #include "chrome/browser/bookmarks/bookmark_model.h" 19 #include "chrome/browser/bookmarks/bookmark_model.h"
19 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 20 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
20 #include "chrome/browser/browser_process.h" 21 #include "chrome/browser/browser_process.h"
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 } 469 }
469 470
470 base::FilePath TestingProfile::GetPath() { 471 base::FilePath TestingProfile::GetPath() {
471 return profile_path_; 472 return profile_path_;
472 } 473 }
473 474
474 scoped_refptr<base::SequencedTaskRunner> TestingProfile::GetIOTaskRunner() { 475 scoped_refptr<base::SequencedTaskRunner> TestingProfile::GetIOTaskRunner() {
475 return MessageLoop::current()->message_loop_proxy(); 476 return MessageLoop::current()->message_loop_proxy();
476 } 477 }
477 478
479 scoped_refptr<base::DeferredSequencedTaskRunner>
480 TestingProfile::GetBookmarksTaskRunner() {
481 if (!bookmarks_task_runner_) {
482 bookmarks_task_runner_ =
483 new base::DeferredSequencedTaskRunner(GetIOTaskRunner());
484 }
485 return bookmarks_task_runner_;
486 }
487
478 TestingPrefServiceSyncable* TestingProfile::GetTestingPrefService() { 488 TestingPrefServiceSyncable* TestingProfile::GetTestingPrefService() {
479 if (!prefs_.get()) 489 if (!prefs_.get())
480 CreateTestingPrefService(); 490 CreateTestingPrefService();
481 DCHECK(testing_prefs_); 491 DCHECK(testing_prefs_);
482 return testing_prefs_; 492 return testing_prefs_;
483 } 493 }
484 494
485 TestingProfile* TestingProfile::AsTestingProfile() { 495 TestingProfile* TestingProfile::AsTestingProfile() {
486 return this; 496 return this;
487 } 497 }
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after
796 806
797 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() { 807 scoped_ptr<TestingProfile> TestingProfile::Builder::Build() {
798 DCHECK(!build_called_); 808 DCHECK(!build_called_);
799 build_called_ = true; 809 build_called_ = true;
800 return scoped_ptr<TestingProfile>(new TestingProfile( 810 return scoped_ptr<TestingProfile>(new TestingProfile(
801 path_, 811 path_,
802 delegate_, 812 delegate_,
803 extension_policy_, 813 extension_policy_,
804 pref_service_.Pass())); 814 pref_service_.Pass()));
805 } 815 }
OLDNEW
« chrome/browser/profiles/profile_impl.cc ('K') | « chrome/test/base/testing_profile.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698