| OLD | NEW |
| 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/gtk/keyword_editor_view.h" | 5 #include "chrome/browser/gtk/keyword_editor_view.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/gfx/gtk_util.h" | 8 #include "base/gfx/gtk_util.h" |
| 9 #include "chrome/browser/gtk/edit_search_engine_dialog.h" | 9 #include "chrome/browser/gtk/edit_search_engine_dialog.h" |
| 10 #include "chrome/browser/profile.h" | 10 #include "chrome/browser/profile.h" |
| (...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 440 GTK_WINDOW(gtk_widget_get_toplevel(editor->dialog_)), | 440 GTK_WINDOW(gtk_widget_get_toplevel(editor->dialog_)), |
| 441 NULL, | 441 NULL, |
| 442 editor, | 442 editor, |
| 443 editor->profile_); | 443 editor->profile_); |
| 444 } | 444 } |
| 445 | 445 |
| 446 // static | 446 // static |
| 447 void KeywordEditorView::OnEditButtonClicked(GtkButton* button, | 447 void KeywordEditorView::OnEditButtonClicked(GtkButton* button, |
| 448 KeywordEditorView* editor) { | 448 KeywordEditorView* editor) { |
| 449 int model_row = editor->GetSelectedModelRow(); | 449 int model_row = editor->GetSelectedModelRow(); |
| 450 if (model_row == -1) { | 450 if (model_row == -1) |
| 451 NOTREACHED(); | |
| 452 return; | 451 return; |
| 453 } | 452 |
| 454 new EditSearchEngineDialog( | 453 new EditSearchEngineDialog( |
| 455 GTK_WINDOW(gtk_widget_get_toplevel(editor->dialog_)), | 454 GTK_WINDOW(gtk_widget_get_toplevel(editor->dialog_)), |
| 456 editor->controller_->GetTemplateURL(model_row), | 455 editor->controller_->GetTemplateURL(model_row), |
| 457 editor, | 456 editor, |
| 458 editor->profile_); | 457 editor->profile_); |
| 459 } | 458 } |
| 460 | 459 |
| 461 // static | 460 // static |
| 462 void KeywordEditorView::OnRemoveButtonClicked(GtkButton* button, | 461 void KeywordEditorView::OnRemoveButtonClicked(GtkButton* button, |
| 463 KeywordEditorView* editor) { | 462 KeywordEditorView* editor) { |
| (...skipping 15 matching lines...) Expand all Loading... |
| 479 int model_row = editor->GetSelectedModelRow(); | 478 int model_row = editor->GetSelectedModelRow(); |
| 480 if (model_row == -1) { | 479 if (model_row == -1) { |
| 481 NOTREACHED(); | 480 NOTREACHED(); |
| 482 return; | 481 return; |
| 483 } | 482 } |
| 484 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); | 483 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); |
| 485 if (new_index > 0) { | 484 if (new_index > 0) { |
| 486 editor->SelectModelRow(new_index); | 485 editor->SelectModelRow(new_index); |
| 487 } | 486 } |
| 488 } | 487 } |
| OLD | NEW |