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/cocoa/history_menu_bridge.h" | 5 #include "chrome/browser/cocoa/history_menu_bridge.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/callback.h" | 9 #include "base/callback.h" |
10 #include "base/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
(...skipping 28 matching lines...) Expand all Loading... |
39 const int kMostVisitedScope = 90; | 39 const int kMostVisitedScope = 90; |
40 | 40 |
41 // The number of most visisted results to get. | 41 // The number of most visisted results to get. |
42 const int kMostVisitedCount = 9; | 42 const int kMostVisitedCount = 9; |
43 | 43 |
44 // The number of recently closed items to get. | 44 // The number of recently closed items to get. |
45 const unsigned int kRecentlyClosedCount = 10; | 45 const unsigned int kRecentlyClosedCount = 10; |
46 | 46 |
47 } // namespace | 47 } // namespace |
48 | 48 |
49 HistoryMenuBridge::HistoryItem::HistoryItem() | |
50 : icon_requested(false), | |
51 menu_item(nil), | |
52 session_id(0) { | |
53 } | |
54 | |
55 HistoryMenuBridge::HistoryItem::HistoryItem(const HistoryItem& copy) | |
56 : title(copy.title), | |
57 url(copy.url), | |
58 icon_requested(false), | |
59 menu_item(nil), | |
60 session_id(copy.session_id) { | |
61 } | |
62 | |
63 HistoryMenuBridge::HistoryItem::~HistoryItem() { | |
64 } | |
65 | |
66 HistoryMenuBridge::HistoryMenuBridge(Profile* profile) | 49 HistoryMenuBridge::HistoryMenuBridge(Profile* profile) |
67 : controller_([[HistoryMenuCocoaController alloc] initWithBridge:this]), | 50 : controller_([[HistoryMenuCocoaController alloc] initWithBridge:this]), |
68 profile_(profile), | 51 profile_(profile), |
69 history_service_(NULL), | 52 history_service_(NULL), |
70 tab_restore_service_(NULL), | 53 tab_restore_service_(NULL), |
71 create_in_progress_(false), | 54 create_in_progress_(false), |
72 need_recreate_(false) { | 55 need_recreate_(false) { |
73 // If we don't have a profile, do not bother initializing our data sources. | 56 // If we don't have a profile, do not bother initializing our data sources. |
74 // This shouldn't happen except in unit tests. | 57 // This shouldn't happen except in unit tests. |
75 if (profile_) { | 58 if (profile_) { |
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
461 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { | 444 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { |
462 DCHECK(item); | 445 DCHECK(item); |
463 if (item->icon_requested) { | 446 if (item->icon_requested) { |
464 FaviconService* service = | 447 FaviconService* service = |
465 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); | 448 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); |
466 service->CancelRequest(item->icon_handle); | 449 service->CancelRequest(item->icon_handle); |
467 item->icon_requested = false; | 450 item->icon_requested = false; |
468 item->icon_handle = NULL; | 451 item->icon_handle = NULL; |
469 } | 452 } |
470 } | 453 } |
OLD | NEW |