| 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/gtk/keyword_editor_view.h" | 5 #include "chrome/browser/gtk/keyword_editor_view.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
| 10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
| (...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 GtkTreePath* path, | 442 GtkTreePath* path, |
| 443 GtkTreeViewColumn* column, | 443 GtkTreeViewColumn* column, |
| 444 KeywordEditorView* editor) { | 444 KeywordEditorView* editor) { |
| 445 OnEditButtonClicked(NULL, editor); | 445 OnEditButtonClicked(NULL, editor); |
| 446 } | 446 } |
| 447 | 447 |
| 448 // static | 448 // static |
| 449 void KeywordEditorView::OnAddButtonClicked(GtkButton* button, | 449 void KeywordEditorView::OnAddButtonClicked(GtkButton* button, |
| 450 KeywordEditorView* editor) { | 450 KeywordEditorView* editor) { |
| 451 new EditSearchEngineDialog( | 451 new EditSearchEngineDialog( |
| 452 GTK_WINDOW(gtk_widget_get_toplevel(editor->dialog_)), | 452 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET( |
| 453 gtk_util::GetDialogWindow(editor->dialog_)))), |
| 453 NULL, | 454 NULL, |
| 454 editor, | 455 editor, |
| 455 editor->profile_); | 456 editor->profile_); |
| 456 } | 457 } |
| 457 | 458 |
| 458 // static | 459 // static |
| 459 void KeywordEditorView::OnEditButtonClicked(GtkButton* button, | 460 void KeywordEditorView::OnEditButtonClicked(GtkButton* button, |
| 460 KeywordEditorView* editor) { | 461 KeywordEditorView* editor) { |
| 461 int model_row = editor->GetSelectedModelRow(); | 462 int model_row = editor->GetSelectedModelRow(); |
| 462 if (model_row == -1) | 463 if (model_row == -1) |
| 463 return; | 464 return; |
| 464 | 465 |
| 465 new EditSearchEngineDialog( | 466 new EditSearchEngineDialog( |
| 466 GTK_WINDOW(gtk_widget_get_toplevel(editor->dialog_)), | 467 GTK_WINDOW(gtk_widget_get_toplevel(GTK_WIDGET( |
| 468 gtk_util::GetDialogWindow(editor->dialog_)))), |
| 467 editor->controller_->GetTemplateURL(model_row), | 469 editor->controller_->GetTemplateURL(model_row), |
| 468 editor, | 470 editor, |
| 469 editor->profile_); | 471 editor->profile_); |
| 470 } | 472 } |
| 471 | 473 |
| 472 // static | 474 // static |
| 473 void KeywordEditorView::OnRemoveButtonClicked(GtkButton* button, | 475 void KeywordEditorView::OnRemoveButtonClicked(GtkButton* button, |
| 474 KeywordEditorView* editor) { | 476 KeywordEditorView* editor) { |
| 475 int model_row = editor->GetSelectedModelRow(); | 477 int model_row = editor->GetSelectedModelRow(); |
| 476 if (model_row == -1) { | 478 if (model_row == -1) { |
| (...skipping 13 matching lines...) Expand all Loading... |
| 490 int model_row = editor->GetSelectedModelRow(); | 492 int model_row = editor->GetSelectedModelRow(); |
| 491 if (model_row == -1) { | 493 if (model_row == -1) { |
| 492 NOTREACHED(); | 494 NOTREACHED(); |
| 493 return; | 495 return; |
| 494 } | 496 } |
| 495 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); | 497 int new_index = editor->controller_->MakeDefaultTemplateURL(model_row); |
| 496 if (new_index > 0) { | 498 if (new_index > 0) { |
| 497 editor->SelectModelRow(new_index); | 499 editor->SelectModelRow(new_index); |
| 498 } | 500 } |
| 499 } | 501 } |
| OLD | NEW |