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 // EditSearchEngineDialog provides text fields for editing a keyword: the title, | 5 // EditSearchEngineDialog provides text fields for editing a keyword: the title, |
6 // url and actual keyword. It is used by the KeywordEditorView of the Options | 6 // url and actual keyword. It is used by the KeywordEditorView of the Options |
7 // dialog, and also on its own to confirm the addition of a keyword added by | 7 // dialog, and also on its own to confirm the addition of a keyword added by |
8 // the ExternalJSObject via the RenderView. | 8 // the ExternalJSObject via the RenderView. |
9 | 9 |
10 #ifndef CHROME_BROWSER_UI_VIEWS_EDIT_SEARCH_ENGINE_DIALOG_H_ | 10 #ifndef CHROME_BROWSER_UI_VIEWS_EDIT_SEARCH_ENGINE_DIALOG_H_ |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
51 virtual void ContentsChanged(views::Textfield* sender, | 51 virtual void ContentsChanged(views::Textfield* sender, |
52 const base::string16& new_contents) OVERRIDE; | 52 const base::string16& new_contents) OVERRIDE; |
53 virtual bool HandleKeyEvent(views::Textfield* sender, | 53 virtual bool HandleKeyEvent(views::Textfield* sender, |
54 const ui::KeyEvent& key_event) OVERRIDE; | 54 const ui::KeyEvent& key_event) OVERRIDE; |
55 private: | 55 private: |
56 void Init(); | 56 void Init(); |
57 | 57 |
58 // Create a Label containing the text with the specified message id. | 58 // Create a Label containing the text with the specified message id. |
59 views::Label* CreateLabel(int message_id); | 59 views::Label* CreateLabel(int message_id); |
60 | 60 |
61 // Creates a text field with the specified text. If |lowercase| is true, the | 61 // Creates a text field with the specified text. |
62 // Textfield is configured to map all input to lower case. | 62 views::Textfield* CreateTextfield(const base::string16& text); |
63 views::Textfield* CreateTextfield(const base::string16& text, bool lowercase); | |
64 | 63 |
65 // Invokes UpdateImageView for each of the images views. | 64 // Invokes UpdateImageView for each of the images views. |
66 void UpdateImageViews(); | 65 void UpdateImageViews(); |
67 | 66 |
68 // Updates the tooltip and image of the image view based on is_valid. If | 67 // Updates the tooltip and image of the image view based on is_valid. If |
69 // is_valid is false the tooltip of the image view is set to the message with | 68 // is_valid is false the tooltip of the image view is set to the message with |
70 // id invalid_message_id, otherwise the tooltip is set to the empty text. | 69 // id invalid_message_id, otherwise the tooltip is set to the empty text. |
71 void UpdateImageView(views::ImageView* image_view, | 70 void UpdateImageView(views::ImageView* image_view, |
72 bool is_valid, | 71 bool is_valid, |
73 int invalid_message_id); | 72 int invalid_message_id); |
(...skipping 10 matching lines...) Expand all Loading... |
84 views::ImageView* title_iv_; | 83 views::ImageView* title_iv_; |
85 views::ImageView* keyword_iv_; | 84 views::ImageView* keyword_iv_; |
86 views::ImageView* url_iv_; | 85 views::ImageView* url_iv_; |
87 | 86 |
88 scoped_ptr<EditSearchEngineController> controller_; | 87 scoped_ptr<EditSearchEngineController> controller_; |
89 | 88 |
90 DISALLOW_COPY_AND_ASSIGN(EditSearchEngineDialog); | 89 DISALLOW_COPY_AND_ASSIGN(EditSearchEngineDialog); |
91 }; | 90 }; |
92 | 91 |
93 #endif // CHROME_BROWSER_UI_VIEWS_EDIT_SEARCH_ENGINE_DIALOG_H_ | 92 #endif // CHROME_BROWSER_UI_VIEWS_EDIT_SEARCH_ENGINE_DIALOG_H_ |
OLD | NEW |