| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/edit_search_engine_dialog.h" | 5 #include "chrome/browser/ui/views/edit_search_engine_dialog.h" |
| 6 | 6 |
| 7 #include "base/i18n/rtl.h" | 7 #include "base/i18n/rtl.h" |
| 8 #include "base/string_util.h" | 8 #include "base/string_util.h" |
| 9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
| 10 #include "chrome/browser/search_engines/template_url.h" | 10 #include "chrome/browser/search_engines/template_url.h" |
| (...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 91 controller_->CleanUpCancelledAdd(); | 91 controller_->CleanUpCancelledAdd(); |
| 92 return true; | 92 return true; |
| 93 } | 93 } |
| 94 | 94 |
| 95 bool EditSearchEngineDialog::Accept() { | 95 bool EditSearchEngineDialog::Accept() { |
| 96 controller_->AcceptAddOrEdit(title_tf_->text(), keyword_tf_->text(), | 96 controller_->AcceptAddOrEdit(title_tf_->text(), keyword_tf_->text(), |
| 97 UTF16ToUTF8(url_tf_->text())); | 97 UTF16ToUTF8(url_tf_->text())); |
| 98 return true; | 98 return true; |
| 99 } | 99 } |
| 100 | 100 |
| 101 views::View* EditSearchEngineDialog::GetContentsView() { | |
| 102 return this; | |
| 103 } | |
| 104 | |
| 105 void EditSearchEngineDialog::ContentsChanged(Textfield* sender, | 101 void EditSearchEngineDialog::ContentsChanged(Textfield* sender, |
| 106 const string16& new_contents) { | 102 const string16& new_contents) { |
| 107 GetDialogClientView()->UpdateDialogButtons(); | 103 GetDialogClientView()->UpdateDialogButtons(); |
| 108 UpdateImageViews(); | 104 UpdateImageViews(); |
| 109 } | 105 } |
| 110 | 106 |
| 111 bool EditSearchEngineDialog::HandleKeyEvent( | 107 bool EditSearchEngineDialog::HandleKeyEvent( |
| 112 Textfield* sender, | 108 Textfield* sender, |
| 113 const ui::KeyEvent& key_event) { | 109 const ui::KeyEvent& key_event) { |
| 114 return false; | 110 return false; |
| (...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 249 int invalid_message_id) { | 245 int invalid_message_id) { |
| 250 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 246 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 251 if (is_valid) { | 247 if (is_valid) { |
| 252 image_view->SetTooltipText(string16()); | 248 image_view->SetTooltipText(string16()); |
| 253 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); | 249 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); |
| 254 } else { | 250 } else { |
| 255 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); | 251 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); |
| 256 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); | 252 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); |
| 257 } | 253 } |
| 258 } | 254 } |
| OLD | NEW |