| 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/cocoa/history_menu_bridge.h" | 5 #include "chrome/browser/ui/cocoa/history_menu_bridge.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/stl_util.h" | 9 #include "base/stl_util.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| (...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 434 if (need_recreate_) | 434 if (need_recreate_) |
| 435 CreateMenu(); | 435 CreateMenu(); |
| 436 | 436 |
| 437 create_in_progress_ = false; | 437 create_in_progress_ = false; |
| 438 } | 438 } |
| 439 | 439 |
| 440 HistoryMenuBridge::HistoryItem* HistoryMenuBridge::HistoryItemForTab( | 440 HistoryMenuBridge::HistoryItem* HistoryMenuBridge::HistoryItemForTab( |
| 441 const TabRestoreService::Tab& entry) { | 441 const TabRestoreService::Tab& entry) { |
| 442 DCHECK(!entry.navigations.empty()); | 442 DCHECK(!entry.navigations.empty()); |
| 443 | 443 |
| 444 const TabNavigation& current_navigation = | 444 const components::SerializedNavigationEntry& current_navigation = |
| 445 entry.navigations.at(entry.current_navigation_index); | 445 entry.navigations.at(entry.current_navigation_index); |
| 446 HistoryItem* item = new HistoryItem(); | 446 HistoryItem* item = new HistoryItem(); |
| 447 item->title = current_navigation.title(); | 447 item->title = current_navigation.title(); |
| 448 item->url = current_navigation.virtual_url(); | 448 item->url = current_navigation.virtual_url(); |
| 449 item->session_id = entry.id; | 449 item->session_id = entry.id; |
| 450 | 450 |
| 451 // Tab navigations don't come with icons, so we always have to request them. | 451 // Tab navigations don't come with icons, so we always have to request them. |
| 452 GetFaviconForHistoryItem(item); | 452 GetFaviconForHistoryItem(item); |
| 453 | 453 |
| 454 return item; | 454 return item; |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 488 } | 488 } |
| 489 | 489 |
| 490 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { | 490 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { |
| 491 DCHECK(item); | 491 DCHECK(item); |
| 492 if (item->icon_requested) { | 492 if (item->icon_requested) { |
| 493 cancelable_task_tracker_.TryCancel(item->icon_task_id); | 493 cancelable_task_tracker_.TryCancel(item->icon_task_id); |
| 494 item->icon_requested = false; | 494 item->icon_requested = false; |
| 495 item->icon_task_id = CancelableTaskTracker::kBadTaskId; | 495 item->icon_task_id = CancelableTaskTracker::kBadTaskId; |
| 496 } | 496 } |
| 497 } | 497 } |
| OLD | NEW |