| 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/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| 11 #include "base/strings/utf_string_conversions.h" | 11 #include "base/strings/utf_string_conversions.h" |
| 12 #include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU | 12 #include "chrome/app/chrome_command_ids.h" // IDC_HISTORY_MENU |
| 13 #include "chrome/browser/chrome_notification_types.h" | 13 #include "chrome/browser/chrome_notification_types.h" |
| 14 #include "chrome/browser/favicon/favicon_service_factory.h" | 14 #include "chrome/browser/favicon/favicon_service_factory.h" |
| 15 #include "chrome/browser/history/history_service_factory.h" | 15 #include "chrome/browser/history/history_service_factory.h" |
| 16 #include "chrome/browser/profiles/profile.h" | 16 #include "chrome/browser/profiles/profile.h" |
| 17 #include "chrome/browser/sessions/tab_restore_service_factory.h" | 17 #include "chrome/browser/sessions/tab_restore_service_factory.h" |
| 18 #import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h" | 18 #import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h" |
| 19 #include "content/public/browser/notification_registrar.h" | 19 #include "content/public/browser/notification_registrar.h" |
| 20 #include "content/public/browser/notification_source.h" | 20 #include "content/public/browser/notification_source.h" |
| 21 #include "grit/generated_resources.h" | 21 #include "grit/generated_resources.h" |
| 22 #include "grit/theme_resources.h" | 22 #include "grit/theme_resources.h" |
| 23 #include "grit/ui_resources.h" | |
| 24 #include "ui/base/l10n/l10n_util.h" | 23 #include "ui/base/l10n/l10n_util.h" |
| 25 #include "ui/base/resource/resource_bundle.h" | 24 #include "ui/base/resource/resource_bundle.h" |
| 26 #include "ui/gfx/image/image.h" | 25 #include "ui/gfx/image/image.h" |
| 27 #include "ui/gfx/text_elider.h" | 26 #include "ui/gfx/text_elider.h" |
| 27 #include "ui/resources/grit/ui_resources.h" |
| 28 | 28 |
| 29 namespace { | 29 namespace { |
| 30 | 30 |
| 31 // Maximum number of pixels to use for a menu item title. | 31 // Maximum number of pixels to use for a menu item title. |
| 32 const float kTitlePixelWidth = 400; | 32 const float kTitlePixelWidth = 400; |
| 33 | 33 |
| 34 // Number of days to consider when getting the number of visited items. | 34 // Number of days to consider when getting the number of visited items. |
| 35 const int kVisitedScope = 90; | 35 const int kVisitedScope = 90; |
| 36 | 36 |
| 37 // The number of visisted results to get. | 37 // The number of visisted results to get. |
| (...skipping 427 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 465 } | 465 } |
| 466 | 466 |
| 467 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { | 467 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { |
| 468 DCHECK(item); | 468 DCHECK(item); |
| 469 if (item->icon_requested) { | 469 if (item->icon_requested) { |
| 470 cancelable_task_tracker_.TryCancel(item->icon_task_id); | 470 cancelable_task_tracker_.TryCancel(item->icon_task_id); |
| 471 item->icon_requested = false; | 471 item->icon_requested = false; |
| 472 item->icon_task_id = base::CancelableTaskTracker::kBadTaskId; | 472 item->icon_task_id = base::CancelableTaskTracker::kBadTaskId; |
| 473 } | 473 } |
| 474 } | 474 } |
| OLD | NEW |