| 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 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 55 TemplateURL* template_url, | 55 TemplateURL* template_url, |
| 56 EditSearchEngineControllerDelegate* delegate, | 56 EditSearchEngineControllerDelegate* delegate, |
| 57 Profile* profile) { | 57 Profile* profile) { |
| 58 EditSearchEngineDialog* contents = | 58 EditSearchEngineDialog* contents = |
| 59 new EditSearchEngineDialog(template_url, delegate, profile); | 59 new EditSearchEngineDialog(template_url, delegate, profile); |
| 60 // Window interprets an empty rectangle as needing to query the content for | 60 // Window interprets an empty rectangle as needing to query the content for |
| 61 // the size as well as centering relative to the parent. | 61 // the size as well as centering relative to the parent. |
| 62 views::Widget::CreateWindowWithParent(contents, parent); | 62 views::Widget::CreateWindowWithParent(contents, parent); |
| 63 contents->GetWidget()->Show(); | 63 contents->GetWidget()->Show(); |
| 64 contents->GetDialogClientView()->UpdateDialogButtons(); | 64 contents->GetDialogClientView()->UpdateDialogButtons(); |
| 65 contents->title_tf_->SelectAll(); | 65 contents->title_tf_->SelectAll(true); |
| 66 contents->title_tf_->RequestFocus(); | 66 contents->title_tf_->RequestFocus(); |
| 67 } | 67 } |
| 68 | 68 |
| 69 ui::ModalType EditSearchEngineDialog::GetModalType() const { | 69 ui::ModalType EditSearchEngineDialog::GetModalType() const { |
| 70 return ui::MODAL_TYPE_WINDOW; | 70 return ui::MODAL_TYPE_WINDOW; |
| 71 } | 71 } |
| 72 | 72 |
| 73 string16 EditSearchEngineDialog::GetWindowTitle() const { | 73 string16 EditSearchEngineDialog::GetWindowTitle() const { |
| 74 return l10n_util::GetStringUTF16(controller_->template_url() ? | 74 return l10n_util::GetStringUTF16(controller_->template_url() ? |
| 75 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : | 75 IDS_SEARCH_ENGINES_EDITOR_EDIT_WINDOW_TITLE : |
| (...skipping 172 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 248 int invalid_message_id) { | 248 int invalid_message_id) { |
| 249 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 249 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
| 250 if (is_valid) { | 250 if (is_valid) { |
| 251 image_view->SetTooltipText(string16()); | 251 image_view->SetTooltipText(string16()); |
| 252 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); | 252 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); |
| 253 } else { | 253 } else { |
| 254 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); | 254 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); |
| 255 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); | 255 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); |
| 256 } | 256 } |
| 257 } | 257 } |
| OLD | NEW |