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

Side by Side Diff: chrome/browser/bookmarks/chrome_bookmark_client.cc

Issue 1198963014: Change ownership of BookmarkClient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@cleanup_managed_and_supervised_nodes
Patch Set: Rebase Created 5 years, 6 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/bookmarks/chrome_bookmark_client.h" 5 #include "chrome/browser/bookmarks/chrome_bookmark_client.h"
6 6
7 #include "base/bind.h" 7 #include "base/bind.h"
8 #include "base/bind_helpers.h" 8 #include "base/bind_helpers.h"
9 #include "base/logging.h" 9 #include "base/logging.h"
10 #include "base/values.h" 10 #include "base/values.h"
(...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after
62 62
63 } // namespace 63 } // namespace
64 64
65 ChromeBookmarkClient::ChromeBookmarkClient(Profile* profile) 65 ChromeBookmarkClient::ChromeBookmarkClient(Profile* profile)
66 : profile_(profile) { 66 : profile_(profile) {
67 } 67 }
68 68
69 ChromeBookmarkClient::~ChromeBookmarkClient() { 69 ChromeBookmarkClient::~ChromeBookmarkClient() {
70 } 70 }
71 71
72 void ChromeBookmarkClient::Init(BookmarkModel* model) { 72 void ChromeBookmarkClient::Init(BookmarkModel* bookmark_model) {
73 DCHECK(model); 73 DCHECK(bookmark_model);
74 managed_bookmarks_tracker_.reset(new ManagedBookmarksTracker( 74 managed_bookmarks_tracker_.reset(new ManagedBookmarksTracker(
75 model, 75 bookmark_model,
76 profile_->GetPrefs(), 76 profile_->GetPrefs(),
77 false, 77 false,
78 base::Bind(&ChromeBookmarkClient::GetManagedBookmarksDomain, 78 base::Bind(&ChromeBookmarkClient::GetManagedBookmarksDomain,
79 base::Unretained(this)))); 79 base::Unretained(this))));
80 supervised_bookmarks_tracker_.reset(new ManagedBookmarksTracker( 80 supervised_bookmarks_tracker_.reset(new ManagedBookmarksTracker(
81 model, 81 bookmark_model,
82 profile_->GetPrefs(), 82 profile_->GetPrefs(),
83 true, 83 true,
84 base::Callback<std::string()>())); 84 base::Callback<std::string()>()));
85 } 85 }
86 86
87 base::CancelableTaskTracker::TaskId 87 base::CancelableTaskTracker::TaskId
88 ChromeBookmarkClient::GetFaviconImageForPageURL( 88 ChromeBookmarkClient::GetFaviconImageForPageURL(
89 const GURL& page_url, 89 const GURL& page_url,
90 favicon_base::IconType type, 90 favicon_base::IconType type,
91 const favicon_base::FaviconImageCallback& callback, 91 const favicon_base::FaviconImageCallback& callback,
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
191 return extra_nodes.Pass(); 191 return extra_nodes.Pass();
192 } 192 }
193 193
194 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { 194 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() {
195 policy::ProfilePolicyConnector* connector = 195 policy::ProfilePolicyConnector* connector =
196 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile_); 196 policy::ProfilePolicyConnectorFactory::GetForBrowserContext(profile_);
197 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) 197 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks))
198 return connector->GetManagementDomain(); 198 return connector->GetManagementDomain();
199 return std::string(); 199 return std::string();
200 } 200 }
OLDNEW
« no previous file with comments | « chrome/browser/bookmarks/chrome_bookmark_client.h ('k') | chrome/browser/bookmarks/chrome_bookmark_client_factory.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698