| 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/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/stl_util-inl.h" | 10 #include "base/stl_util-inl.h" |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 162 TableColumn::LEFT, -1, .25)); | 162 TableColumn::LEFT, -1, .25)); |
| 163 columns.back().sortable = true; | 163 columns.back().sortable = true; |
| 164 table_view_ = new views::TableView(controller_->table_model(), columns, | 164 table_view_ = new views::TableView(controller_->table_model(), columns, |
| 165 views::ICON_AND_TEXT, false, true, true); | 165 views::ICON_AND_TEXT, false, true, true); |
| 166 table_view_->SetObserver(this); | 166 table_view_->SetObserver(this); |
| 167 | 167 |
| 168 add_button_ = new views::NativeButton( | 168 add_button_ = new views::NativeButton( |
| 169 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)); | 169 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_NEW_BUTTON)); |
| 170 add_button_->SetEnabled(controller_->loaded()); | 170 add_button_->SetEnabled(controller_->loaded()); |
| 171 add_button_->AddAccelerator( | 171 add_button_->AddAccelerator( |
| 172 views::Accelerator(base::VKEY_A, false, false, true)); | 172 views::Accelerator(app::VKEY_A, false, false, true)); |
| 173 add_button_->SetAccessibleKeyboardShortcut(L"A"); | 173 add_button_->SetAccessibleKeyboardShortcut(L"A"); |
| 174 | 174 |
| 175 edit_button_ = new views::NativeButton( | 175 edit_button_ = new views::NativeButton( |
| 176 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON)); | 176 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_EDIT_BUTTON)); |
| 177 edit_button_->SetEnabled(false); | 177 edit_button_->SetEnabled(false); |
| 178 | 178 |
| 179 remove_button_ = new views::NativeButton( | 179 remove_button_ = new views::NativeButton( |
| 180 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)); | 180 this, l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_REMOVE_BUTTON)); |
| 181 remove_button_->SetEnabled(false); | 181 remove_button_->SetEnabled(false); |
| 182 remove_button_->AddAccelerator( | 182 remove_button_->AddAccelerator( |
| 183 views::Accelerator(base::VKEY_R, false, false, true)); | 183 views::Accelerator(app::VKEY_R, false, false, true)); |
| 184 remove_button_->SetAccessibleKeyboardShortcut(L"R"); | 184 remove_button_->SetAccessibleKeyboardShortcut(L"R"); |
| 185 | 185 |
| 186 make_default_button_ = new views::NativeButton( | 186 make_default_button_ = new views::NativeButton( |
| 187 this, | 187 this, |
| 188 l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON)); | 188 l10n_util::GetString(IDS_SEARCH_ENGINES_EDITOR_MAKE_DEFAULT_BUTTON)); |
| 189 make_default_button_->SetEnabled(false); | 189 make_default_button_->SetEnabled(false); |
| 190 | 190 |
| 191 InitLayoutManager(); | 191 InitLayoutManager(); |
| 192 } | 192 } |
| 193 | 193 |
| (...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 add_button_->SetEnabled(controller_->loaded()); | 297 add_button_->SetEnabled(controller_->loaded()); |
| 298 } | 298 } |
| 299 | 299 |
| 300 void KeywordEditorView::MakeDefaultTemplateURL() { | 300 void KeywordEditorView::MakeDefaultTemplateURL() { |
| 301 int new_index = | 301 int new_index = |
| 302 controller_->MakeDefaultTemplateURL(table_view_->FirstSelectedRow()); | 302 controller_->MakeDefaultTemplateURL(table_view_->FirstSelectedRow()); |
| 303 if (new_index >= 0) | 303 if (new_index >= 0) |
| 304 table_view_->Select(new_index); | 304 table_view_->Select(new_index); |
| 305 default_chosen_ = true; | 305 default_chosen_ = true; |
| 306 } | 306 } |
| OLD | NEW |