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 "base/base_paths.h" | 7 #include "base/base_paths.h" |
8 #include "base/command_line.h" | 8 #include "base/command_line.h" |
9 #include "base/file_util.h" | 9 #include "base/file_util.h" |
10 #include "base/message_loop/message_loop_proxy.h" | 10 #include "base/message_loop/message_loop_proxy.h" |
(...skipping 512 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
523 } | 523 } |
524 | 524 |
525 static KeyedService* BuildChromeBookmarkClient( | 525 static KeyedService* BuildChromeBookmarkClient( |
526 content::BrowserContext* context) { | 526 content::BrowserContext* context) { |
527 return new ChromeBookmarkClient(static_cast<Profile*>(context)); | 527 return new ChromeBookmarkClient(static_cast<Profile*>(context)); |
528 } | 528 } |
529 | 529 |
530 static KeyedService* BuildChromeHistoryClient( | 530 static KeyedService* BuildChromeHistoryClient( |
531 content::BrowserContext* context) { | 531 content::BrowserContext* context) { |
532 Profile* profile = static_cast<Profile*>(context); | 532 Profile* profile = static_cast<Profile*>(context); |
533 return new ChromeHistoryClient(BookmarkModelFactory::GetForProfile(profile)); | 533 return new ChromeHistoryClient(BookmarkModelFactory::GetForProfile(profile), |
sdefresne
2014/08/04 08:47:19
Pass the Profile* as an additional parameter.
| |
534 profile->GetTopSites()); | |
534 } | 535 } |
535 | 536 |
536 void TestingProfile::CreateBookmarkModel(bool delete_file) { | 537 void TestingProfile::CreateBookmarkModel(bool delete_file) { |
537 if (delete_file) { | 538 if (delete_file) { |
538 base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); | 539 base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); |
539 base::DeleteFile(path, false); | 540 base::DeleteFile(path, false); |
540 } | 541 } |
541 ChromeHistoryClientFactory::GetInstance()->SetTestingFactory( | 542 ChromeHistoryClientFactory::GetInstance()->SetTestingFactory( |
542 this, BuildChromeHistoryClient); | 543 this, BuildChromeHistoryClient); |
543 ChromeBookmarkClientFactory::GetInstance()->SetTestingFactory( | 544 ChromeBookmarkClientFactory::GetInstance()->SetTestingFactory( |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
958 path_, | 959 path_, |
959 delegate_, | 960 delegate_, |
960 extension_policy_, | 961 extension_policy_, |
961 pref_service_.Pass(), | 962 pref_service_.Pass(), |
962 incognito_, | 963 incognito_, |
963 guest_session_, | 964 guest_session_, |
964 supervised_user_id_, | 965 supervised_user_id_, |
965 policy_service_.Pass(), | 966 policy_service_.Pass(), |
966 testing_factories_)); | 967 testing_factories_)); |
967 } | 968 } |
OLD | NEW |