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

Side by Side Diff: chrome/browser/ui/sync/profile_signin_confirmation_helper.cc

Issue 2216713002: Use BookmarkModelFactory::GetForBrowserContext everywhere (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@bookmarks
Patch Set: Replace in .mm files Created 4 years, 4 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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/browser/ui/sync/profile_signin_confirmation_helper.h" 5 #include "chrome/browser/ui/sync/profile_signin_confirmation_helper.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/memory/ref_counted.h" 8 #include "base/memory/ref_counted.h"
9 #include "build/build_config.h" 9 #include "build/build_config.h"
10 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 10 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
(...skipping 15 matching lines...) Expand all
26 #include "extensions/common/extension_set.h" 26 #include "extensions/common/extension_set.h"
27 #endif 27 #endif
28 28
29 using bookmarks::BookmarkModel; 29 using bookmarks::BookmarkModel;
30 30
31 namespace { 31 namespace {
32 32
33 const int kHistoryEntriesBeforeNewProfilePrompt = 10; 33 const int kHistoryEntriesBeforeNewProfilePrompt = 10;
34 34
35 bool HasBookmarks(Profile* profile) { 35 bool HasBookmarks(Profile* profile) {
36 BookmarkModel* bookmarks = BookmarkModelFactory::GetForProfile(profile); 36 BookmarkModel* bookmarks =
37 BookmarkModelFactory::GetForBrowserContext(profile);
37 bool has_bookmarks = bookmarks && bookmarks->HasBookmarks(); 38 bool has_bookmarks = bookmarks && bookmarks->HasBookmarks();
38 if (has_bookmarks) 39 if (has_bookmarks)
39 DVLOG(1) << "SigninConfirmationHelper: profile contains bookmarks"; 40 DVLOG(1) << "SigninConfirmationHelper: profile contains bookmarks";
40 return has_bookmarks; 41 return has_bookmarks;
41 } 42 }
42 43
43 } // namespace 44 } // namespace
44 45
45 namespace ui { 46 namespace ui {
46 47
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after
95 history::HistoryService* service = 96 history::HistoryService* service =
96 HistoryServiceFactory::GetForProfileWithoutCreating(profile); 97 HistoryServiceFactory::GetForProfileWithoutCreating(profile);
97 // Fire asynchronous queries for profile data. 98 // Fire asynchronous queries for profile data.
98 sync_driver::SigninConfirmationHelper* helper = 99 sync_driver::SigninConfirmationHelper* helper =
99 new sync_driver::SigninConfirmationHelper(service, return_result); 100 new sync_driver::SigninConfirmationHelper(service, return_result);
100 helper->CheckHasHistory(kHistoryEntriesBeforeNewProfilePrompt); 101 helper->CheckHasHistory(kHistoryEntriesBeforeNewProfilePrompt);
101 helper->CheckHasTypedURLs(); 102 helper->CheckHasTypedURLs();
102 } 103 }
103 104
104 } // namespace ui 105 } // namespace ui
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698