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

Side by Side Diff: chrome/browser/views/keyword_editor_view.cc

Issue 518028: views/gtk: Add missing keyboard accelerators to Search Engines dialog. (Closed)
Patch Set: added views side Created 10 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 unified diff | Download patch
« no previous file with comments | « chrome/browser/gtk/keyword_editor_view.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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/views/keyword_editor_view.h" 5 #include "chrome/browser/views/keyword_editor_view.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "app/l10n_util.h" 9 #include "app/l10n_util.h"
10 #include "base/gfx/point.h" 10 #include "base/gfx/point.h"
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
148 TableColumn(IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN, 148 TableColumn(IDS_SEARCH_ENGINES_EDITOR_KEYWORD_COLUMN,
149 TableColumn::LEFT, -1, .25)); 149 TableColumn::LEFT, -1, .25));
150 columns.back().sortable = true; 150 columns.back().sortable = true;
151 table_view_ = new views::TableView(controller_->table_model(), columns, 151 table_view_ = new views::TableView(controller_->table_model(), columns,
152 views::ICON_AND_TEXT, false, true, true); 152 views::ICON_AND_TEXT, false, true, true);
153 table_view_->SetObserver(this); 153 table_view_->SetObserver(this);
154 154
155 add_button_ = new views::NativeButton( 155 add_button_ = new views::NativeButton(
156 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)); 156 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON));
157 add_button_->SetEnabled(controller_->loaded()); 157 add_button_->SetEnabled(controller_->loaded());
158 add_button_->AddAccelerator(
159 views::Accelerator(base::VKEY_A, false, false, true));
160 add_button_->SetAccessibleKeyboardShortcut(L"A");
158 161
159 edit_button_ = new views::NativeButton( 162 edit_button_ = new views::NativeButton(
160 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON)); 163 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON));
161 edit_button_->SetEnabled(false); 164 edit_button_->SetEnabled(false);
162 165
163 remove_button_ = new views::NativeButton( 166 remove_button_ = new views::NativeButton(
164 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)); 167 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON));
165 remove_button_->SetEnabled(false); 168 remove_button_->SetEnabled(false);
169 remove_button_->AddAccelerator(
170 views::Accelerator(base::VKEY_R, false, false, true));
171 remove_button_->SetAccessibleKeyboardShortcut(L"R");
166 172
167 make_default_button_ = new views::NativeButton( 173 make_default_button_ = new views::NativeButton(
168 this, 174 this,
169 l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON)); 175 l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON));
170 make_default_button_->SetEnabled(false); 176 make_default_button_->SetEnabled(false);
171 177
172 InitLayoutManager(); 178 InitLayoutManager();
173 } 179 }
174 180
175 void KeywordEditorView::InitLayoutManager() { 181 void KeywordEditorView::InitLayoutManager() {
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
273 void KeywordEditorView::OnTemplateURLModelChanged() { 279 void KeywordEditorView::OnTemplateURLModelChanged() {
274 add_button_->SetEnabled(controller_->loaded()); 280 add_button_->SetEnabled(controller_->loaded());
275 } 281 }
276 282
277 void KeywordEditorView::MakeDefaultTemplateURL() { 283 void KeywordEditorView::MakeDefaultTemplateURL() {
278 int new_index = 284 int new_index =
279 controller_->MakeDefaultTemplateURL(table_view_->FirstSelectedRow()); 285 controller_->MakeDefaultTemplateURL(table_view_->FirstSelectedRow());
280 if (new_index >= 0) 286 if (new_index >= 0)
281 table_view_->Select(new_index); 287 table_view_->Select(new_index);
282 } 288 }
OLDNEW
« no previous file with comments | « chrome/browser/gtk/keyword_editor_view.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698