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 #include "chrome/browser/chromeos/input_method/candidate_window.h" | 5 #include "chrome/browser/chromeos/input_method/candidate_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 1028 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1039 previous_annotation_column_width_ == annotation_column_width) { | 1039 previous_annotation_column_width_ == annotation_column_width) { |
1040 return; | 1040 return; |
1041 } | 1041 } |
1042 | 1042 |
1043 // Update the previous column widths. | 1043 // Update the previous column widths. |
1044 previous_shortcut_column_width_ = shortcut_column_width; | 1044 previous_shortcut_column_width_ = shortcut_column_width; |
1045 previous_candidate_column_width_ = candidate_column_width; | 1045 previous_candidate_column_width_ = candidate_column_width; |
1046 previous_annotation_column_width_ = annotation_column_width; | 1046 previous_annotation_column_width_ = annotation_column_width; |
1047 | 1047 |
1048 // Clear the existing candidate_views if any. | 1048 // Clear the existing candidate_views if any. |
1049 for (size_t i = 0; i < candidate_views_.size(); ++i) { | 1049 candidate_area_contents->RemoveAllChildViews(true); |
1050 candidate_area_contents->RemoveChildView(candidate_views_[i]); | |
1051 } | |
1052 candidate_views_.clear(); | 1050 candidate_views_.clear(); |
1053 | 1051 |
1054 views::GridLayout* layout = new views::GridLayout(candidate_area_contents); | 1052 views::GridLayout* layout = new views::GridLayout(candidate_area_contents); |
1055 // |candidate_area_contents| owns |layout|. | 1053 // |candidate_area_contents| owns |layout|. |
1056 candidate_area_contents->SetLayoutManager(layout); | 1054 candidate_area_contents->SetLayoutManager(layout); |
1057 // Initialize the column set. | 1055 // Initialize the column set. |
1058 views::ColumnSet* column_set = layout->AddColumnSet(0); | 1056 views::ColumnSet* column_set = layout->AddColumnSet(0); |
1059 if (orientation == InputMethodLookupTable::kVertical) { | 1057 if (orientation == InputMethodLookupTable::kVertical) { |
1060 column_set->AddColumn(views::GridLayout::FILL, | 1058 column_set->AddColumn(views::GridLayout::FILL, |
1061 views::GridLayout::FILL, | 1059 views::GridLayout::FILL, |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1346 CandidateWindowController::~CandidateWindowController() { | 1344 CandidateWindowController::~CandidateWindowController() { |
1347 delete impl_; | 1345 delete impl_; |
1348 } | 1346 } |
1349 | 1347 |
1350 bool CandidateWindowController::Init() { | 1348 bool CandidateWindowController::Init() { |
1351 return impl_->Init(); | 1349 return impl_->Init(); |
1352 } | 1350 } |
1353 | 1351 |
1354 } // namespace input_method | 1352 } // namespace input_method |
1355 } // namespace chromeos | 1353 } // namespace chromeos |
OLD | NEW |