| 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_CONTROLLER_IMPL_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL_H_ |
| 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL_H_ | 6 #define CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL_H_ |
| 7 | 7 |
| 8 #include "chrome/browser/chromeos/input_method/candidate_window_controller.h" | 8 #include "chrome/browser/chromeos/input_method/candidate_window_controller.h" |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 60 // |has_highlighted| to true if infolist_entries contains highlighted entry. | 60 // |has_highlighted| to true if infolist_entries contains highlighted entry. |
| 61 // TODO(mukai): move this method (and tests) to the new InfolistEntry model. | 61 // TODO(mukai): move this method (and tests) to the new InfolistEntry model. |
| 62 static void ConvertLookupTableToInfolistEntry( | 62 static void ConvertLookupTableToInfolistEntry( |
| 63 const CandidateWindow& candidate_window, | 63 const CandidateWindow& candidate_window, |
| 64 std::vector<InfolistEntry>* infolist_entries, | 64 std::vector<InfolistEntry>* infolist_entries, |
| 65 bool* has_highlighted); | 65 bool* has_highlighted); |
| 66 | 66 |
| 67 private: | 67 private: |
| 68 // CandidateWindowView::Observer implementation. | 68 // CandidateWindowView::Observer implementation. |
| 69 virtual void OnCandidateCommitted(int index) OVERRIDE; | 69 virtual void OnCandidateCommitted(int index) OVERRIDE; |
| 70 virtual void OnCandidateWindowOpened() OVERRIDE; | |
| 71 virtual void OnCandidateWindowClosed() OVERRIDE; | |
| 72 | 70 |
| 73 // views::WidgetObserver implementation. | 71 // views::WidgetObserver implementation. |
| 74 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; | 72 virtual void OnWidgetClosing(views::Widget* widget) OVERRIDE; |
| 75 | 73 |
| 76 // IBusPanelCandidateWindowHandlerInterface implementation. | 74 // IBusPanelCandidateWindowHandlerInterface implementation. |
| 77 virtual void SetCursorBounds(const gfx::Rect& cursor_bounds, | 75 virtual void SetCursorBounds(const gfx::Rect& cursor_bounds, |
| 78 const gfx::Rect& composition_head) OVERRIDE; | 76 const gfx::Rect& composition_head) OVERRIDE; |
| 79 virtual void UpdateAuxiliaryText(const std::string& utf8_text, | 77 virtual void UpdateAuxiliaryText(const std::string& utf8_text, |
| 80 bool visible) OVERRIDE; | 78 bool visible) OVERRIDE; |
| 81 virtual void UpdateLookupTable(const CandidateWindow& candidate_window, | 79 virtual void UpdateLookupTable(const CandidateWindow& candidate_window, |
| 82 bool visible) OVERRIDE; | 80 bool visible) OVERRIDE; |
| 83 virtual void UpdatePreeditText(const std::string& utf8_text, | 81 virtual void UpdatePreeditText(const std::string& utf8_text, |
| 84 unsigned int cursor, bool visible) OVERRIDE; | 82 unsigned int cursor, bool visible) OVERRIDE; |
| 85 virtual void FocusStateChanged(bool is_focused) OVERRIDE; | 83 virtual void FocusStateChanged(bool is_focused) OVERRIDE; |
| 86 | 84 |
| 87 // Creates the candidate window view. | 85 // Creates the candidate window view. |
| 88 void CreateView(); | 86 void CreateView(); |
| 89 | 87 |
| 88 void InitCandidateWindowView(); |
| 89 |
| 90 // Updates infolist bounds, if current bounds is up-to-date, this function | 90 // Updates infolist bounds, if current bounds is up-to-date, this function |
| 91 // does nothing. | 91 // does nothing. |
| 92 gfx::Rect GetInfolistBounds(); | 92 gfx::Rect GetInfolistBounds(); |
| 93 | 93 |
| 94 // The candidate window view. | 94 // The candidate window view. |
| 95 CandidateWindowView* candidate_window_view_; | 95 CandidateWindowView* candidate_window_view_; |
| 96 | 96 |
| 97 // This is the outer frame of the candidate window view. The frame will | |
| 98 // own |candidate_window_|. | |
| 99 scoped_ptr<views::Widget> frame_; | |
| 100 | |
| 101 // This is the outer frame of the infolist window view. Owned by the widget. | 97 // This is the outer frame of the infolist window view. Owned by the widget. |
| 102 InfolistWindow* infolist_window_; | 98 InfolistWindow* infolist_window_; |
| 103 | 99 |
| 100 gfx::Rect cursor_bounds_; |
| 101 gfx::Rect composition_head_; |
| 102 |
| 104 // This is the controller of the IME mode indicator. | 103 // This is the controller of the IME mode indicator. |
| 105 scoped_ptr<ModeIndicatorController> mode_indicator_controller_; | 104 scoped_ptr<ModeIndicatorController> mode_indicator_controller_; |
| 106 | 105 |
| 107 // The infolist entries and its focused index which currently shown in | 106 // The infolist entries and its focused index which currently shown in |
| 108 // Infolist window. | 107 // Infolist window. |
| 109 std::vector<InfolistEntry> latest_infolist_entries_; | 108 std::vector<InfolistEntry> latest_infolist_entries_; |
| 110 | 109 |
| 111 ObserverList<CandidateWindowController::Observer> observers_; | 110 ObserverList<CandidateWindowController::Observer> observers_; |
| 112 | 111 |
| 113 DISALLOW_COPY_AND_ASSIGN(CandidateWindowControllerImpl); | 112 DISALLOW_COPY_AND_ASSIGN(CandidateWindowControllerImpl); |
| 114 }; | 113 }; |
| 115 | 114 |
| 116 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL
_H_ | 115 #endif // CHROME_BROWSER_CHROMEOS_INPUT_METHOD_CANDIDATE_WINDOW_CONTROLLER_IMPL
_H_ |
| 117 | 116 |
| 118 } // namespace input_method | 117 } // namespace input_method |
| 119 } // namespace chromeos | 118 } // namespace chromeos |
| OLD | NEW |