Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(399)

Side by Side Diff: chrome/browser/cocoa/history_menu_bridge.mm

Issue 3296003: FBTF: Move the TabRestoreService::Observer into its own file. (Closed) Base URL: http://src.chromium.org/git/chromium.git
Patch Set: More mac fixes Created 10 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
49 HistoryMenuBridge::HistoryMenuBridge(Profile* profile) 66 HistoryMenuBridge::HistoryMenuBridge(Profile* profile)
50 : controller_([[HistoryMenuCocoaController alloc] initWithBridge:this]), 67 : controller_([[HistoryMenuCocoaController alloc] initWithBridge:this]),
51 profile_(profile), 68 profile_(profile),
52 history_service_(NULL), 69 history_service_(NULL),
53 tab_restore_service_(NULL), 70 tab_restore_service_(NULL),
54 create_in_progress_(false), 71 create_in_progress_(false),
55 need_recreate_(false) { 72 need_recreate_(false) {
56 // If we don't have a profile, do not bother initializing our data sources. 73 // If we don't have a profile, do not bother initializing our data sources.
57 // This shouldn't happen except in unit tests. 74 // This shouldn't happen except in unit tests.
58 if (profile_) { 75 if (profile_) {
(...skipping 385 matching lines...) Expand 10 before | Expand all | Expand 10 after
444 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) { 461 void HistoryMenuBridge::CancelFaviconRequest(HistoryItem* item) {
445 DCHECK(item); 462 DCHECK(item);
446 if (item->icon_requested) { 463 if (item->icon_requested) {
447 FaviconService* service = 464 FaviconService* service =
448 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS); 465 profile_->GetFaviconService(Profile::EXPLICIT_ACCESS);
449 service->CancelRequest(item->icon_handle); 466 service->CancelRequest(item->icon_handle);
450 item->icon_requested = false; 467 item->icon_requested = false;
451 item->icon_handle = NULL; 468 item->icon_handle = NULL;
452 } 469 }
453 } 470 }
OLDNEW
« no previous file with comments | « chrome/browser/cocoa/history_menu_bridge.h ('k') | chrome/browser/cocoa/view_id_util_browsertest.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698