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