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

Unified Diff: chrome/browser/ui/views/omnibox/omnibox_view_views.cc

Issue 9250016: Aura: Add "Edit Search Engines" option to the aura omnibox context menu. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: patch Created 8 years, 11 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/views/omnibox/omnibox_view_views.cc
diff --git a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
index b0f6ac270cce6b9eb580ecb7dfd5917835d1cf9d..48546768eed27eef43a6414f73ed37f6292896f4 100644
--- a/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
+++ b/chrome/browser/ui/views/omnibox/omnibox_view_views.cc
@@ -30,6 +30,7 @@
#include "ui/base/dragdrop/os_exchange_data.h"
#include "ui/base/ime/text_input_type.h"
#include "ui/base/l10n/l10n_util.h"
+#include "ui/base/models/simple_menu_model.h"
#include "ui/base/resource/resource_bundle.h"
#include "ui/gfx/font.h"
#include "ui/gfx/render_text.h"
@@ -715,6 +716,22 @@ void OmniboxViewViews::OnWriteDragData(ui::OSExchangeData* data) {
data->SetURL(url, selected_text);
}
+void OmniboxViewViews::UpdateContextMenu(ui::SimpleMenuModel* menu_contents) {
+ // Minor note: We use IDC_ for command id here while the underlying textfield
+ // is using IDS_ for all its command ids. This is because views cannot depend
+ // on IDC_ for now.
+ menu_contents->AddItemWithStringId(IDC_EDIT_SEARCH_ENGINES,
+ IDS_EDIT_SEARCH_ENGINES);
+}
+
+bool OmniboxViewViews::IsCommandIdEnabled(int command_id) const {
+ return command_updater_->IsCommandEnabled(command_id);
+}
+
+void OmniboxViewViews::ExecuteCommand(int command_id) {
+ command_updater_->ExecuteCommand(command_id);
+}
+
#if defined(OS_CHROMEOS)
void OmniboxViewViews::CandidateWindowOpened(
chromeos::input_method::InputMethodManager* manager) {
« no previous file with comments | « chrome/browser/ui/views/omnibox/omnibox_view_views.h ('k') | ui/views/controls/textfield/native_textfield_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698