| 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" |
| 11 #include "chrome/browser/favicon/favicon_service.h" | 11 #include "chrome/browser/favicon/favicon_service.h" |
| 12 #include "chrome/browser/favicon/favicon_service_factory.h" | 12 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 13 #include "chrome/browser/history/history_service.h" | 13 #include "chrome/browser/history/history_service.h" |
| 14 #include "chrome/browser/policy/profile_policy_connector.h" | 14 #include "chrome/browser/policy/profile_policy_connector.h" |
| 15 #include "chrome/browser/policy/profile_policy_connector_factory.h" | 15 #include "chrome/browser/policy/profile_policy_connector_factory.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "components/bookmarks/browser/bookmark_model.h" | 17 #include "components/bookmarks/browser/bookmark_model.h" |
| 18 #include "components/bookmarks/browser/bookmark_node.h" | 18 #include "components/bookmarks/browser/bookmark_node.h" |
| 19 #include "components/history/core/browser/url_database.h" | 19 #include "components/history/core/browser/url_database.h" |
| 20 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 21 #include "content/public/browser/notification_details.h" | 21 #include "content/public/browser/notification_details.h" |
| 22 #include "content/public/browser/notification_source.h" | 22 #include "content/public/browser/notification_source.h" |
| 23 #include "content/public/browser/user_metrics.h" | 23 #include "content/public/browser/user_metrics.h" |
| 24 #include "grit/components_strings.h" | 24 #include "grit/components_strings.h" |
| 25 #include "policy/policy_constants.h" | 25 #include "policy/policy_constants.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 | 27 |
| 28 using bookmarks::BookmarkModel; | 28 using bookmarks::BookmarkModel; |
| 29 using bookmarks::BookmarkNode; |
| 30 using bookmarks::BookmarkPermanentNode; |
| 29 | 31 |
| 30 namespace { | 32 namespace { |
| 31 | 33 |
| 32 void RunCallbackWithImage( | 34 void RunCallbackWithImage( |
| 33 const favicon_base::FaviconImageCallback& callback, | 35 const favicon_base::FaviconImageCallback& callback, |
| 34 const favicon_base::FaviconRawBitmapResult& bitmap_result) { | 36 const favicon_base::FaviconRawBitmapResult& bitmap_result) { |
| 35 favicon_base::FaviconImageResult result; | 37 favicon_base::FaviconImageResult result; |
| 36 if (bitmap_result.is_valid()) { | 38 if (bitmap_result.is_valid()) { |
| 37 result.image = gfx::Image::CreateFrom1xPNGBytes( | 39 result.image = gfx::Image::CreateFrom1xPNGBytes( |
| 38 bitmap_result.bitmap_data->front(), bitmap_result.bitmap_data->size()); | 40 bitmap_result.bitmap_data->front(), bitmap_result.bitmap_data->size()); |
| (...skipping 212 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 251 return extra_nodes.Pass(); | 253 return extra_nodes.Pass(); |
| 252 } | 254 } |
| 253 | 255 |
| 254 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { | 256 std::string ChromeBookmarkClient::GetManagedBookmarksDomain() { |
| 255 policy::ProfilePolicyConnector* connector = | 257 policy::ProfilePolicyConnector* connector = |
| 256 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_); | 258 policy::ProfilePolicyConnectorFactory::GetForProfile(profile_); |
| 257 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) | 259 if (connector->IsPolicyFromCloudPolicy(policy::key::kManagedBookmarks)) |
| 258 return connector->GetManagementDomain(); | 260 return connector->GetManagementDomain(); |
| 259 return std::string(); | 261 return std::string(); |
| 260 } | 262 } |
| OLD | NEW |