OLD | NEW |
---|---|
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" |
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
488 // need to be run to properly shutdown. Run all pending tasks now. This is | 488 // need to be run to properly shutdown. Run all pending tasks now. This is |
489 // normally handled by browser_process shutdown. | 489 // normally handled by browser_process shutdown. |
490 if (base::MessageLoop::current()) | 490 if (base::MessageLoop::current()) |
491 base::MessageLoop::current()->RunUntilIdle(); | 491 base::MessageLoop::current()->RunUntilIdle(); |
492 } | 492 } |
493 } | 493 } |
494 | 494 |
495 static KeyedService* BuildBookmarkModel(content::BrowserContext* context) { | 495 static KeyedService* BuildBookmarkModel(content::BrowserContext* context) { |
496 Profile* profile = static_cast<Profile*>(context); | 496 Profile* profile = static_cast<Profile*>(context); |
497 BookmarkModel* bookmark_model = new BookmarkModel(profile); | 497 BookmarkModel* bookmark_model = new BookmarkModel(profile); |
498 bookmark_model->Load(profile->GetIOTaskRunner()); | 498 bookmark_model->Load(profile->GetIOTaskRunner(), |
sdefresne
2014/04/18 22:31:48
This won't compile.
| |
499 content::BrowserThread::GetMessageLoopProxyForThread( | |
500 content::BrowserThread::UI)); | |
499 return bookmark_model; | 501 return bookmark_model; |
500 } | 502 } |
501 | 503 |
502 void TestingProfile::CreateBookmarkModel(bool delete_file) { | 504 void TestingProfile::CreateBookmarkModel(bool delete_file) { |
503 if (delete_file) { | 505 if (delete_file) { |
504 base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); | 506 base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); |
505 base::DeleteFile(path, false); | 507 base::DeleteFile(path, false); |
506 } | 508 } |
507 // This will create a bookmark model. | 509 // This will create a bookmark model. |
508 BookmarkModel* bookmark_service = static_cast<BookmarkModel*>( | 510 BookmarkModel* bookmark_service = static_cast<BookmarkModel*>( |
(...skipping 450 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
959 path_, | 961 path_, |
960 delegate_, | 962 delegate_, |
961 extension_policy_, | 963 extension_policy_, |
962 pref_service_.Pass(), | 964 pref_service_.Pass(), |
963 incognito_, | 965 incognito_, |
964 guest_session_, | 966 guest_session_, |
965 managed_user_id_, | 967 managed_user_id_, |
966 policy_service_.Pass(), | 968 policy_service_.Pass(), |
967 testing_factories_)); | 969 testing_factories_)); |
968 } | 970 } |
OLD | NEW |