OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 "chrome/browser/chromeos/input_method/ibus_ui_controller.h" | 8 #include "chrome/browser/chromeos/input_method/ibus_ui_controller.h" |
9 #include "ui/views/view.h" | 9 #include "ui/views/view.h" |
10 | 10 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
133 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; | 133 virtual void OnBoundsChanged(const gfx::Rect& previous_bounds) OVERRIDE; |
134 | 134 |
135 private: | 135 private: |
136 // Initializes the candidate views if needed. | 136 // Initializes the candidate views if needed. |
137 void MaybeInitializeCandidateViews( | 137 void MaybeInitializeCandidateViews( |
138 const InputMethodLookupTable& lookup_table); | 138 const InputMethodLookupTable& lookup_table); |
139 | 139 |
140 // Returns the appropriate area (header or footer) to put auxiliary texts. | 140 // Returns the appropriate area (header or footer) to put auxiliary texts. |
141 InformationTextArea* GetAuxiliaryTextArea(); | 141 InformationTextArea* GetAuxiliaryTextArea(); |
142 | 142 |
| 143 // Returns true if the candidate window is open. The suggestion window does |
| 144 // not count as the candidate window. |
143 bool IsCandidateWindowOpen() const; | 145 bool IsCandidateWindowOpen() const; |
144 | 146 |
| 147 // Notifies observers if the candidate window's opened/closed state has |
| 148 // changed from the previous call to this function. |
| 149 void NotifyIfCandidateWindowOpenedOrClosed(); |
| 150 |
145 // The lookup table (candidates). | 151 // The lookup table (candidates). |
146 InputMethodLookupTable lookup_table_; | 152 InputMethodLookupTable lookup_table_; |
147 | 153 |
148 // The index in the current page of the candidate currently being selected. | 154 // The index in the current page of the candidate currently being selected. |
149 int selected_candidate_index_in_page_; | 155 int selected_candidate_index_in_page_; |
150 | 156 |
151 // The observers of the object. | 157 // The observers of the object. |
152 ObserverList<Observer> observers_; | 158 ObserverList<Observer> observers_; |
153 | 159 |
154 // The parent frame. | 160 // The parent frame. |
(...skipping 30 matching lines...) Expand all Loading... |
185 // This location is used by suggestion window rendering which is mostly used | 191 // This location is used by suggestion window rendering which is mostly used |
186 // by ibus-mozc. The suggestion window should be aligned with the composition | 192 // by ibus-mozc. The suggestion window should be aligned with the composition |
187 // text as opposed to the cursor. In case of ibus-mozc, suggestion window | 193 // text as opposed to the cursor. In case of ibus-mozc, suggestion window |
188 // location is calculated by engine and it carried by update_lookup_table | 194 // location is calculated by engine and it carried by update_lookup_table |
189 // signal as additional information. This value is available when | 195 // signal as additional information. This value is available when |
190 // is_suggestion_window_available is true. | 196 // is_suggestion_window_available is true. |
191 gfx::Rect suggestion_window_location_; | 197 gfx::Rect suggestion_window_location_; |
192 | 198 |
193 bool is_suggestion_window_location_available_; | 199 bool is_suggestion_window_location_available_; |
194 | 200 |
| 201 // True if the candidate window was open. This is used to determine when to |
| 202 // send OnCandidateWindowOpened and OnCandidateWindowClosed events. |
| 203 bool was_candidate_window_open_; |
| 204 |
195 DISALLOW_COPY_AND_ASSIGN(CandidateWindowView); | 205 DISALLOW_COPY_AND_ASSIGN(CandidateWindowView); |
196 }; | 206 }; |
197 | 207 |
198 } // namespace input_method | 208 } // namespace input_method |
199 } // namespace chromeos | 209 } // namespace chromeos |
200 | 210 |
201 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ | 211 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_VIEW_H_ |
OLD | NEW |