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), |
| 534 profile, |
| 535 profile->GetTopSites()); |
534 } | 536 } |
535 | 537 |
536 void TestingProfile::CreateBookmarkModel(bool delete_file) { | 538 void TestingProfile::CreateBookmarkModel(bool delete_file) { |
537 if (delete_file) { | 539 if (delete_file) { |
538 base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); | 540 base::FilePath path = GetPath().Append(bookmarks::kBookmarksFileName); |
539 base::DeleteFile(path, false); | 541 base::DeleteFile(path, false); |
540 } | 542 } |
541 ChromeHistoryClientFactory::GetInstance()->SetTestingFactory( | 543 ChromeHistoryClientFactory::GetInstance()->SetTestingFactory( |
542 this, BuildChromeHistoryClient); | 544 this, BuildChromeHistoryClient); |
543 ChromeBookmarkClientFactory::GetInstance()->SetTestingFactory( | 545 ChromeBookmarkClientFactory::GetInstance()->SetTestingFactory( |
(...skipping 414 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
958 path_, | 960 path_, |
959 delegate_, | 961 delegate_, |
960 extension_policy_, | 962 extension_policy_, |
961 pref_service_.Pass(), | 963 pref_service_.Pass(), |
962 incognito_, | 964 incognito_, |
963 guest_session_, | 965 guest_session_, |
964 supervised_user_id_, | 966 supervised_user_id_, |
965 policy_service_.Pass(), | 967 policy_service_.Pass(), |
966 testing_factories_)); | 968 testing_factories_)); |
967 } | 969 } |
OLD | NEW |