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/case_conversion.h" | 7 #include "base/i18n/case_conversion.h" |
8 #include "base/i18n/rtl.h" | 8 #include "base/i18n/rtl.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 | 55 |
56 // static | 56 // static |
57 void EditSearchEngineDialog::Show(gfx::NativeWindow parent, | 57 void EditSearchEngineDialog::Show(gfx::NativeWindow parent, |
58 TemplateURL* template_url, | 58 TemplateURL* template_url, |
59 EditSearchEngineControllerDelegate* delegate, | 59 EditSearchEngineControllerDelegate* delegate, |
60 Profile* profile) { | 60 Profile* profile) { |
61 EditSearchEngineDialog* contents = | 61 EditSearchEngineDialog* contents = |
62 new EditSearchEngineDialog(template_url, delegate, profile); | 62 new EditSearchEngineDialog(template_url, delegate, profile); |
63 // Window interprets an empty rectangle as needing to query the content for | 63 // Window interprets an empty rectangle as needing to query the content for |
64 // the size as well as centering relative to the parent. | 64 // the size as well as centering relative to the parent. |
65 CreateBrowserModalDialogViews(contents, parent); | 65 CreateWindowModalDialogViews(contents, parent); |
66 contents->GetWidget()->Show(); | 66 contents->GetWidget()->Show(); |
67 contents->GetDialogClientView()->UpdateDialogButtons(); | 67 contents->GetDialogClientView()->UpdateDialogButtons(); |
68 contents->title_tf_->SelectAll(true); | 68 contents->title_tf_->SelectAll(true); |
69 contents->title_tf_->RequestFocus(); | 69 contents->title_tf_->RequestFocus(); |
70 } | 70 } |
71 | 71 |
72 ui::ModalType EditSearchEngineDialog::GetModalType() const { | 72 ui::ModalType EditSearchEngineDialog::GetModalType() const { |
73 return ui::MODAL_TYPE_WINDOW; | 73 return ui::MODAL_TYPE_WINDOW; |
74 } | 74 } |
75 | 75 |
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
254 int invalid_message_id) { | 254 int invalid_message_id) { |
255 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); | 255 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); |
256 if (is_valid) { | 256 if (is_valid) { |
257 image_view->SetTooltipText(base::string16()); | 257 image_view->SetTooltipText(base::string16()); |
258 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); | 258 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_GOOD)); |
259 } else { | 259 } else { |
260 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); | 260 image_view->SetTooltipText(l10n_util::GetStringUTF16(invalid_message_id)); |
261 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); | 261 image_view->SetImage(rb.GetImageSkiaNamed(IDR_INPUT_ALERT)); |
262 } | 262 } |
263 } | 263 } |
OLD | NEW |