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

Unified Diff: chrome/browser/ui/views/wrench_menu.cc

Issue 11298004: alternate ntp: add "Recent Tabs" submenu to wrench menu (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/wrench_menu.cc
diff --git a/chrome/browser/ui/views/wrench_menu.cc b/chrome/browser/ui/views/wrench_menu.cc
index 6ca5a5b437d0f6dd65fb98ec8671fb63df25c7a3..607447a34f71b3079e45cf56e5d35cabf15358ac 100644
--- a/chrome/browser/ui/views/wrench_menu.cc
+++ b/chrome/browser/ui/views/wrench_menu.cc
@@ -19,6 +19,7 @@
#include "chrome/browser/ui/browser_window.h"
#include "chrome/browser/ui/search/search.h"
#include "chrome/browser/ui/search/search_model.h"
+#include "chrome/browser/ui/toolbar/recent_tabs_menu_model_delegate.h"
#include "chrome/browser/ui/views/bookmarks/bookmark_menu_delegate.h"
#include "chrome/common/chrome_notification_types.h"
#include "content/public/browser/host_zoom_map.h"
@@ -758,6 +759,7 @@ void WrenchMenu::RunMenu(views::MenuButton* host) {
if (model)
model->RemoveObserver(this);
}
+ recent_tabs_menu_model_delegate_.reset();
sky 2012/11/07 00:10:47 Is there a reason to explicitly destroy this here?
kuan 2012/11/07 02:29:46 the only reason is wherever we stop observing book
sky 2012/11/07 14:40:12 But your code doesn't need to be cleaned up explic
kuan 2012/11/07 16:48:52 Done.
if (selected_menu_model_)
selected_menu_model_->ActivatedAt(selected_index_);
}
@@ -892,7 +894,7 @@ void WrenchMenu::ExecuteCommand(int id, int mouse_event_flags) {
return;
}
- return entry.first->ActivatedAt(entry.second);
+ return entry.first->ActivatedAt(entry.second, mouse_event_flags);
}
bool WrenchMenu::GetAccelerator(int id, ui::Accelerator* accelerator) {
@@ -945,7 +947,6 @@ void WrenchMenu::BookmarkModelChanged() {
root_->Cancel();
}
-
void WrenchMenu::Observe(int type,
const content::NotificationSource& source,
const content::NotificationDetails& details) {
@@ -1016,6 +1017,15 @@ void WrenchMenu::PopulateMenu(MenuItemView* parent,
feedback_menu_item_ = item;
break;
+ case IDC_RECENT_TABS_MENU:
+ DCHECK(chrome::search::IsInstantExtendedAPIEnabled(
+ browser_->profile()));
+ DCHECK(!recent_tabs_menu_model_delegate_.get());
+ recent_tabs_menu_model_delegate_.reset(
+ new RecentTabsMenuModelDelegate(model->GetSubmenuModelAt(index),
+ item));
+ break;
+
default:
break;
}

Powered by Google App Engine
This is Rietveld 408576698