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/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 354 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
365 | 365 |
366 DCHECK(partner_bookmarks_shim_ != NULL); | 366 DCHECK(partner_bookmarks_shim_ != NULL); |
367 const BookmarkNode* node = GetNodeByID(args); | 367 const BookmarkNode* node = GetNodeByID(args); |
368 if (!node) | 368 if (!node) |
369 return; | 369 return; |
370 | 370 |
371 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( | 371 FaviconService* favicon_service = FaviconServiceFactory::GetForProfile( |
372 profile, Profile::EXPLICIT_ACCESS); | 372 profile, Profile::EXPLICIT_ACCESS); |
373 favicon_service->GetRawFaviconForURL( | 373 favicon_service->GetRawFaviconForURL( |
374 FaviconService::FaviconForURLParams( | 374 FaviconService::FaviconForURLParams( |
375 profile, | |
376 node->url(), | 375 node->url(), |
377 chrome::TOUCH_PRECOMPOSED_ICON | chrome::TOUCH_ICON | | 376 chrome::TOUCH_PRECOMPOSED_ICON | chrome::TOUCH_ICON | |
378 chrome::FAVICON, | 377 chrome::FAVICON, |
379 0), // request the largest icon. | 378 0), // request the largest icon. |
380 ui::SCALE_FACTOR_100P, // density doesn't matter for the largest icon. | 379 ui::SCALE_FACTOR_100P, // density doesn't matter for the largest icon. |
381 base::Bind(&BookmarksHandler::OnShortcutFaviconDataAvailable, | 380 base::Bind(&BookmarksHandler::OnShortcutFaviconDataAvailable, |
382 base::Unretained(this), | 381 base::Unretained(this), |
383 node), | 382 node), |
384 &cancelable_task_tracker_); | 383 &cancelable_task_tracker_); |
385 } | 384 } |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
451 web_ui()->GetWebContents()->GetBrowserContext())->GetPrefs(); | 450 web_ui()->GetWebContents()->GetBrowserContext())->GetPrefs(); |
452 return partner_bookmarks_shim_->IsBookmarkEditable(node) && | 451 return partner_bookmarks_shim_->IsBookmarkEditable(node) && |
453 !managed_bookmarks_shim_->IsManagedBookmark(node) && | 452 !managed_bookmarks_shim_->IsManagedBookmark(node) && |
454 pref->GetBoolean(prefs::kEditBookmarksEnabled); | 453 pref->GetBoolean(prefs::kEditBookmarksEnabled); |
455 } | 454 } |
456 | 455 |
457 bool BookmarksHandler::IsRoot(const BookmarkNode* node) const { | 456 bool BookmarksHandler::IsRoot(const BookmarkNode* node) const { |
458 return partner_bookmarks_shim_->IsRootNode(node) && | 457 return partner_bookmarks_shim_->IsRootNode(node) && |
459 node != managed_bookmarks_shim_->GetManagedBookmarksRoot(); | 458 node != managed_bookmarks_shim_->GetManagedBookmarksRoot(); |
460 } | 459 } |
OLD | NEW |