| 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_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
| (...skipping 15 matching lines...) Expand all Loading... |
| 26 #include "grit/generated_resources.h" | 26 #include "grit/generated_resources.h" |
| 27 #include "grit/theme_resources.h" | 27 #include "grit/theme_resources.h" |
| 28 #include "grit/ui_resources.h" | 28 #include "grit/ui_resources.h" |
| 29 #include "skia/ext/skia_utils_mac.h" | 29 #include "skia/ext/skia_utils_mac.h" |
| 30 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
| 31 #include "ui/base/l10n/l10n_util.h" | 31 #include "ui/base/l10n/l10n_util.h" |
| 32 #include "ui/base/resource/resource_bundle.h" | 32 #include "ui/base/resource/resource_bundle.h" |
| 33 #include "ui/gfx/codec/png_codec.h" | 33 #include "ui/gfx/codec/png_codec.h" |
| 34 #include "ui/gfx/favicon_size.h" | 34 #include "ui/gfx/favicon_size.h" |
| 35 #include "ui/gfx/image/image.h" | 35 #include "ui/gfx/image/image.h" |
| 36 #include "ui/gfx/mac/nsimage_cache.h" | |
| 37 | 36 |
| 38 namespace { | 37 namespace { |
| 39 | 38 |
| 40 // Menus more than this many chars long will get trimmed. | 39 // Menus more than this many chars long will get trimmed. |
| 41 const NSUInteger kMaximumMenuWidthInChars = 50; | 40 const NSUInteger kMaximumMenuWidthInChars = 50; |
| 42 | 41 |
| 43 // When trimming, use this many chars from each side. | 42 // When trimming, use this many chars from each side. |
| 44 const NSUInteger kMenuTrimSizeInChars = 25; | 43 const NSUInteger kMenuTrimSizeInChars = 25; |
| 45 | 44 |
| 46 // Number of days to consider when getting the number of visited items. | 45 // Number of days to consider when getting the number of visited items. |
| (...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 489 } | 488 } |
| 490 | 489 |
| 491 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { | 490 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { |
| 492 DCHECK(item); | 491 DCHECK(item); |
| 493 if (item->icon_requested) { | 492 if (item->icon_requested) { |
| 494 cancelable_task_tracker_.TryCancel(item->icon_task_id); | 493 cancelable_task_tracker_.TryCancel(item->icon_task_id); |
| 495 item->icon_requested = false; | 494 item->icon_requested = false; |
| 496 item->icon_task_id = CancelableTaskTracker::kBadTaskId; | 495 item->icon_task_id = CancelableTaskTracker::kBadTaskId; |
| 497 } | 496 } |
| 498 } | 497 } |
| OLD | NEW |