| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/callback.h" | 7 #include "base/callback.h" |
| 8 #include "base/stl_util-inl.h" | 8 #include "base/stl_util-inl.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_util.h" | 10 #include "base/string_util.h" |
| 11 #include "base/sys_string_conversions.h" | 11 #include "base/sys_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 #import "chrome/browser/app_controller_mac.h" | 13 #import "chrome/browser/app_controller_mac.h" |
| 14 #include "chrome/browser/history/page_usage_data.h" | 14 #include "chrome/browser/history/page_usage_data.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/sessions/session_types.h" | 16 #include "chrome/browser/sessions/session_types.h" |
| 17 #import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h" | 17 #import "chrome/browser/ui/cocoa/history_menu_cocoa_controller.h" |
| 18 #include "chrome/common/notification_registrar.h" | 18 #include "chrome/common/notification_registrar.h" |
| 19 #include "chrome/common/notification_service.h" | 19 #include "chrome/common/notification_service.h" |
| 20 #include "chrome/common/url_constants.h" | 20 #include "chrome/common/url_constants.h" |
| 21 #include "grit/app_resources.h" | 21 #include "grit/app_resources.h" |
| 22 #include "grit/generated_resources.h" | 22 #include "grit/generated_resources.h" |
| 23 #include "grit/theme_resources.h" | 23 #include "grit/theme_resources.h" |
| 24 #include "skia/ext/skia_utils_mac.h" | 24 #include "skia/ext/skia_utils_mac.h" |
| 25 #include "third_party/skia/include/core/SkBitmap.h" | 25 #include "third_party/skia/include/core/SkBitmap.h" |
| 26 #include "ui/base/l10n/l10n_util.h" | 26 #include "ui/base/l10n/l10n_util.h" |
| 27 #include "ui/base/resource/resource_bundle.h" | 27 #include "ui/base/resource/resource_bundle.h" |
| 28 #include "ui/gfx/codec/png_codec.h" | 28 #include "ui/gfx/codec/png_codec.h" |
| 29 #include "ui/gfx/image.h" |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 32 // Menus more than this many chars long will get trimmed. | 33 // Menus more than this many chars long will get trimmed. |
| 33 const NSUInteger kMaximumMenuWidthInChars = 50; | 34 const NSUInteger kMaximumMenuWidthInChars = 50; |
| 34 | 35 |
| 35 // When trimming, use this many chars from each side. | 36 // When trimming, use this many chars from each side. |
| 36 const NSUInteger kMenuTrimSizeInChars = 25; | 37 const NSUInteger kMenuTrimSizeInChars = 25; |
| 37 | 38 |
| 38 // Number of days to consider when getting the number of most visited items. | 39 // Number of days to consider when getting the number of most visited items. |
| (...skipping 421 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { | 461 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { |
| 461 DCHECK(item); | 462 DCHECK(item); |
| 462 if (item->icon_requested) { | 463 if (item->icon_requested) { |
| 463 FaviconService* service = | 464 FaviconService* service = |
| 464 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); | 465 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); |
| 465 service->CancelRequest(item->icon_handle); | 466 service->CancelRequest(item->icon_handle); |
| 466 item->icon_requested = false; | 467 item->icon_requested = false; |
| 467 item->icon_handle = NULL; | 468 item->icon_handle = NULL; |
| 468 } | 469 } |
| 469 } | 470 } |
| OLD | NEW |