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 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
7 | 7 |
8 #include "chromeos/ime/candidate_window.h" | 8 #include "ui/base/ime/candidate_window.h" |
9 #include "ui/views/bubble/bubble_delegate.h" | 9 #include "ui/views/bubble/bubble_delegate.h" |
10 #include "ui/views/controls/button/button.h" | 10 #include "ui/views/controls/button/button.h" |
11 | 11 |
12 namespace chromeos { | 12 namespace chromeos { |
13 namespace input_method { | 13 namespace input_method { |
14 | 14 |
15 class CandidateView; | 15 class CandidateView; |
16 class InformationTextArea; | 16 class InformationTextArea; |
17 | 17 |
18 // CandidateWindowView is the main container of the candidate window UI. | 18 // CandidateWindowView is the main container of the candidate window UI. |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
57 void ShowAuxiliaryText(); | 57 void ShowAuxiliaryText(); |
58 | 58 |
59 // Shows the preedit text. | 59 // Shows the preedit text. |
60 void ShowPreeditText(); | 60 void ShowPreeditText(); |
61 | 61 |
62 // Updates the preedit text. | 62 // Updates the preedit text. |
63 void UpdatePreeditText(const std::string& utf8_text); | 63 void UpdatePreeditText(const std::string& utf8_text); |
64 | 64 |
65 // Updates candidates of the candidate window from |candidate_window|. | 65 // Updates candidates of the candidate window from |candidate_window|. |
66 // Candidates are arranged per |orientation|. | 66 // Candidates are arranged per |orientation|. |
67 void UpdateCandidates(const CandidateWindow& candidate_window); | 67 void UpdateCandidates(const ui::CandidateWindow& candidate_window); |
68 | 68 |
69 void SetCursorBounds(const gfx::Rect& cursor_bounds, | 69 void SetCursorBounds(const gfx::Rect& cursor_bounds, |
70 const gfx::Rect& composition_head); | 70 const gfx::Rect& composition_head); |
71 | 71 |
72 private: | 72 private: |
73 friend class CandidateWindowViewTest; | 73 friend class CandidateWindowViewTest; |
74 | 74 |
75 // Overridden from views::ButtonListener: | 75 // Overridden from views::ButtonListener: |
76 virtual void ButtonPressed(views::Button* sender, | 76 virtual void ButtonPressed(views::Button* sender, |
77 const ui::Event& event) OVERRIDE; | 77 const ui::Event& event) OVERRIDE; |
78 | 78 |
79 void SelectCandidateAt(int index_in_page); | 79 void SelectCandidateAt(int index_in_page); |
80 void UpdateVisibility(); | 80 void UpdateVisibility(); |
81 | 81 |
82 // Initializes the candidate views if needed. | 82 // Initializes the candidate views if needed. |
83 void MaybeInitializeCandidateViews(const CandidateWindow& candidate_window); | 83 void MaybeInitializeCandidateViews( |
| 84 const ui::CandidateWindow& candidate_window); |
84 | 85 |
85 // The candidate window data model. | 86 // The candidate window data model. |
86 CandidateWindow candidate_window_; | 87 ui::CandidateWindow candidate_window_; |
87 | 88 |
88 // The index in the current page of the candidate currently being selected. | 89 // The index in the current page of the candidate currently being selected. |
89 int selected_candidate_index_in_page_; | 90 int selected_candidate_index_in_page_; |
90 | 91 |
91 // The observers of the object. | 92 // The observers of the object. |
92 ObserverList<Observer> observers_; | 93 ObserverList<Observer> observers_; |
93 | 94 |
94 // Views created in the class will be part of tree of |this|, so these | 95 // Views created in the class will be part of tree of |this|, so these |
95 // child views will be deleted when |this| is deleted. | 96 // child views will be deleted when |this| is deleted. |
96 InformationTextArea* auxiliary_text_; | 97 InformationTextArea* auxiliary_text_; |
(...skipping 26 matching lines...) Expand all Loading... |
123 // send OnCandidateWindowOpened and OnCandidateWindowClosed events. | 124 // send OnCandidateWindowOpened and OnCandidateWindowClosed events. |
124 bool was_candidate_window_open_; | 125 bool was_candidate_window_open_; |
125 | 126 |
126 DISALLOW_COPY_AND_ASSIGN(CandidateWindowView); | 127 DISALLOW_COPY_AND_ASSIGN(CandidateWindowView); |
127 }; | 128 }; |
128 | 129 |
129 } // namespace input_method | 130 } // namespace input_method |
130 } // namespace chromeos | 131 } // namespace chromeos |
131 | 132 |
132 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 133 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
OLD | NEW |