| 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 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 130 | 130 |
| 131 std::wstring KeywordEditorView::GetWindowName() const { | 131 std::wstring KeywordEditorView::GetWindowName() const { |
| 132 return prefs::kKeywordEditorWindowPlacement; | 132 return prefs::kKeywordEditorWindowPlacement; |
| 133 } | 133 } |
| 134 | 134 |
| 135 int KeywordEditorView::GetDialogButtons() const { | 135 int KeywordEditorView::GetDialogButtons() const { |
| 136 return MessageBoxFlags::DIALOGBUTTON_CANCEL; | 136 return MessageBoxFlags::DIALOGBUTTON_CANCEL; |
| 137 } | 137 } |
| 138 | 138 |
| 139 bool KeywordEditorView::Accept() { | 139 bool KeywordEditorView::Accept() { |
| 140 if (observer_) | |
| 141 observer_->SearchEngineChosen( | |
| 142 profile_->GetTemplateURLModel()->GetDefaultSearchProvider()); | |
| 143 open_window = NULL; | 140 open_window = NULL; |
| 144 return true; | 141 return true; |
| 145 } | 142 } |
| 146 | 143 |
| 147 bool KeywordEditorView::Cancel() { | 144 bool KeywordEditorView::Cancel() { |
| 148 if (observer_) | |
| 149 observer_->SearchEngineChosen( | |
| 150 profile_->GetTemplateURLModel()->GetDefaultSearchProvider()); | |
| 151 open_window = NULL; | 145 open_window = NULL; |
| 152 return true; | 146 return true; |
| 153 } | 147 } |
| 154 | 148 |
| 155 views::View* KeywordEditorView::GetContentsView() { | 149 views::View* KeywordEditorView::GetContentsView() { |
| 156 return this; | 150 return this; |
| 157 } | 151 } |
| 158 | 152 |
| 159 void KeywordEditorView::Init() { | 153 void KeywordEditorView::Init() { |
| 160 std::vector<TableColumn> columns; | 154 std::vector<TableColumn> columns; |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 302 add_button_->SetEnabled(controller_->loaded()); | 296 add_button_->SetEnabled(controller_->loaded()); |
| 303 } | 297 } |
| 304 | 298 |
| 305 void KeywordEditorView::MakeDefaultTemplateURL() { | 299 void KeywordEditorView::MakeDefaultTemplateURL() { |
| 306 int new_index = | 300 int new_index = |
| 307 controller_->MakeDefaultTemplateURL(table_view_->FirstSelectedRow()); | 301 controller_->MakeDefaultTemplateURL(table_view_->FirstSelectedRow()); |
| 308 if (new_index >= 0) | 302 if (new_index >= 0) |
| 309 table_view_->Select(new_index); | 303 table_view_->Select(new_index); |
| 310 default_chosen_ = true; | 304 default_chosen_ = true; |
| 311 } | 305 } |
| OLD | NEW |