| 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/browser/ui/webui/ntp/android/bookmarks_handler.h" | 5 #include "chrome/browser/ui/webui/ntp/android/bookmarks_handler.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/memory/ref_counted_memory.h" | 8 #include "base/memory/ref_counted_memory.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/prefs/pref_service.h" | 10 #include "base/prefs/pref_service.h" |
| (...skipping 388 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 399 | 399 |
| 400 DCHECK(partner_bookmarks_shim_ != NULL); | 400 DCHECK(partner_bookmarks_shim_ != NULL); |
| 401 const BookmarkNode* node = GetNodeByID(args); | 401 const BookmarkNode* node = GetNodeByID(args); |
| 402 if (!node) | 402 if (!node) |
| 403 return; | 403 return; |
| 404 | 404 |
| 405 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( | 405 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
| 406 profile, Profile::EXPLICIT_ACCESS); | 406 profile, Profile::EXPLICIT_ACCESS); |
| 407 favicon_service->GetRawFaviconForURL( | 407 favicon_service->GetRawFaviconForURL( |
| 408 FaviconService::FaviconForURLParams( | 408 FaviconService::FaviconForURLParams( |
| 409 profile, | |
| 410 node->url(), | 409 node->url(), |
| 411 chrome::TOUCH_PRECOMPOSED_ICON | chrome::TOUCH_ICON | | 410 chrome::TOUCH_PRECOMPOSED_ICON | chrome::TOUCH_ICON | |
| 412 chrome::FAVICON, | 411 chrome::FAVICON, |
| 413 0), // request the largest icon. | 412 0), // request the largest icon. |
| 414 ui::SCALE_FACTOR_100P, // density doesn't matter for the largest icon. | 413 ui::SCALE_FACTOR_100P, // density doesn't matter for the largest icon. |
| 415 base::Bind(&BookmarksHandler::OnShortcutFaviconDataAvailable, | 414 base::Bind(&BookmarksHandler::OnShortcutFaviconDataAvailable, |
| 416 base::Unretained(this), | 415 base::Unretained(this), |
| 417 node), | 416 node), |
| 418 &cancelable_task_tracker_); | 417 &cancelable_task_tracker_); |
| 419 } | 418 } |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 517 return true; | 516 return true; |
| 518 | 517 |
| 519 return !managed_bookmarks_shim_->IsManagedBookmark(node); | 518 return !managed_bookmarks_shim_->IsManagedBookmark(node); |
| 520 } | 519 } |
| 521 | 520 |
| 522 bool BookmarksHandler::IsRoot(const BookmarkNode* node) const { | 521 bool BookmarksHandler::IsRoot(const BookmarkNode* node) const { |
| 523 return node->is_root() && | 522 return node->is_root() && |
| 524 node != partner_bookmarks_shim_->GetPartnerBookmarksRoot() && | 523 node != partner_bookmarks_shim_->GetPartnerBookmarksRoot() && |
| 525 node != managed_bookmarks_shim_->GetManagedBookmarksRoot(); | 524 node != managed_bookmarks_shim_->GetManagedBookmarksRoot(); |
| 526 } | 525 } |
| OLD | NEW |