OLD | NEW |
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 Loading... |
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 Loading... |
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 } |
OLD | NEW |