| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "ui/chromeos/ime/candidate_window_view.h" | 5 #include "ui/chromeos/ime/candidate_window_view.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 | 10 |
| (...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 | 88 |
| 89 int selected_candidate_index_in_page() { | 89 int selected_candidate_index_in_page() { |
| 90 return candidate_window_view_->selected_candidate_index_in_page_; | 90 return candidate_window_view_->selected_candidate_index_in_page_; |
| 91 } | 91 } |
| 92 | 92 |
| 93 size_t GetCandidatesSize() const { | 93 size_t GetCandidatesSize() const { |
| 94 return candidate_window_view_->candidate_views_.size(); | 94 return candidate_window_view_->candidate_views_.size(); |
| 95 } | 95 } |
| 96 | 96 |
| 97 CandidateView* GetCandidateAt(size_t i) { | 97 CandidateView* GetCandidateAt(size_t i) { |
| 98 return candidate_window_view_->candidate_views_[i]; | 98 return candidate_window_view_->candidate_views_[i].get(); |
| 99 } | 99 } |
| 100 | 100 |
| 101 void SelectCandidateAt(int index_in_page) { | 101 void SelectCandidateAt(int index_in_page) { |
| 102 candidate_window_view_->SelectCandidateAt(index_in_page); | 102 candidate_window_view_->SelectCandidateAt(index_in_page); |
| 103 } | 103 } |
| 104 | 104 |
| 105 void MaybeInitializeCandidateViews( | 105 void MaybeInitializeCandidateViews( |
| 106 const ui::CandidateWindow& candidate_window) { | 106 const ui::CandidateWindow& candidate_window) { |
| 107 candidate_window_view_->MaybeInitializeCandidateViews(candidate_window); | 107 candidate_window_view_->MaybeInitializeCandidateViews(candidate_window); |
| 108 } | 108 } |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 386 // Check the selected index is invalidated. | 386 // Check the selected index is invalidated. |
| 387 EXPECT_EQ(-1, selected_candidate_index_in_page()); | 387 EXPECT_EQ(-1, selected_candidate_index_in_page()); |
| 388 EXPECT_EQ(before_height, GetCandidateAt(0)->GetContentsBounds().height()); | 388 EXPECT_EQ(before_height, GetCandidateAt(0)->GetContentsBounds().height()); |
| 389 // Checks all entry have same row height. | 389 // Checks all entry have same row height. |
| 390 for (size_t i = 1; i < GetCandidatesSize(); ++i) | 390 for (size_t i = 1; i < GetCandidatesSize(); ++i) |
| 391 EXPECT_EQ(before_height, GetCandidateAt(i)->GetContentsBounds().height()); | 391 EXPECT_EQ(before_height, GetCandidateAt(i)->GetContentsBounds().height()); |
| 392 } | 392 } |
| 393 | 393 |
| 394 } // namespace ime | 394 } // namespace ime |
| 395 } // namespace ui | 395 } // namespace ui |
| OLD | NEW |