| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "views/controls/button/native_button.h" | 30 #include "views/controls/button/native_button.h" |
| 31 #include "views/controls/table/table_view.h" | 31 #include "views/controls/table/table_view.h" |
| 32 #include "views/controls/textfield/textfield.h" | 32 #include "views/controls/textfield/textfield.h" |
| 33 #include "views/standard_layout.h" | 33 #include "views/standard_layout.h" |
| 34 #include "views/widget/widget.h" | 34 #include "views/widget/widget.h" |
| 35 #include "views/window/dialog_delegate.h" | 35 #include "views/window/dialog_delegate.h" |
| 36 #include "views/window/window.h" | 36 #include "views/window/window.h" |
| 37 | 37 |
| 38 using views::GridLayout; | 38 using views::GridLayout; |
| 39 using views::NativeButton; | 39 using views::NativeButton; |
| 40 using views::TableColumn; | |
| 41 | 40 |
| 42 // Group IDs used by TemplateURLTableModel. | 41 // Group IDs used by TemplateURLTableModel. |
| 43 static const int kMainGroupID = 0; | 42 static const int kMainGroupID = 0; |
| 44 static const int kOtherGroupID = 1; | 43 static const int kOtherGroupID = 1; |
| 45 | 44 |
| 46 namespace browser { | 45 namespace browser { |
| 47 | 46 |
| 48 // Declared in browser_dialogs.h so others don't have to depend on our header. | 47 // Declared in browser_dialogs.h so others don't have to depend on our header. |
| 49 void ShowKeywordEditorView(Profile* profile) { | 48 void ShowKeywordEditorView(Profile* profile) { |
| 50 KeywordEditorView::Show(profile); | 49 KeywordEditorView::Show(profile); |
| (...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 230 NOTREACHED(); | 229 NOTREACHED(); |
| 231 return std::wstring(); | 230 return std::wstring(); |
| 232 } | 231 } |
| 233 } | 232 } |
| 234 | 233 |
| 235 SkBitmap TemplateURLTableModel::GetIcon(int row) { | 234 SkBitmap TemplateURLTableModel::GetIcon(int row) { |
| 236 DCHECK(row >= 0 && row < RowCount()); | 235 DCHECK(row >= 0 && row < RowCount()); |
| 237 return entries_[row]->GetIcon(); | 236 return entries_[row]->GetIcon(); |
| 238 } | 237 } |
| 239 | 238 |
| 240 void TemplateURLTableModel::SetObserver(views::TableModelObserver* observer) { | 239 void TemplateURLTableModel::SetObserver(TableModelObserver* observer) { |
| 241 observer_ = observer; | 240 observer_ = observer; |
| 242 } | 241 } |
| 243 | 242 |
| 244 bool TemplateURLTableModel::HasGroups() { | 243 bool TemplateURLTableModel::HasGroups() { |
| 245 return true; | 244 return true; |
| 246 } | 245 } |
| 247 | 246 |
| 248 TemplateURLTableModel::Groups TemplateURLTableModel::GetGroups() { | 247 TemplateURLTableModel::Groups TemplateURLTableModel::GetGroups() { |
| 249 Groups groups; | 248 Groups groups; |
| 250 | 249 |
| (...skipping 394 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 645 } | 644 } |
| 646 const int new_index = table_model_->IndexOfTemplateURL(keyword); | 645 const int new_index = table_model_->IndexOfTemplateURL(keyword); |
| 647 table_model_->NotifyChanged(new_index); | 646 table_model_->NotifyChanged(new_index); |
| 648 | 647 |
| 649 // Make sure the new default is in the main group. | 648 // Make sure the new default is in the main group. |
| 650 table_model_->MoveToMainGroup(index); | 649 table_model_->MoveToMainGroup(index); |
| 651 | 650 |
| 652 // And select it. | 651 // And select it. |
| 653 table_view_->Select(table_model_->IndexOfTemplateURL(keyword)); | 652 table_view_->Select(table_model_->IndexOfTemplateURL(keyword)); |
| 654 } | 653 } |
| OLD | NEW |