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 #include "chrome/browser/chromeos/input_method/candidate_window_view.h" | 4 #include "chrome/browser/chromeos/input_method/candidate_window_view.h" |
5 | 5 |
6 #include <string> | 6 #include <string> |
7 | 7 |
8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/chromeos/input_method/candidate_view.h" | 10 #include "chrome/browser/chromeos/input_method/candidate_view.h" |
(...skipping 771 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
782 | 782 |
783 // Update the previous column widths. | 783 // Update the previous column widths. |
784 previous_shortcut_column_size_ = shortcut_column_size; | 784 previous_shortcut_column_size_ = shortcut_column_size; |
785 previous_candidate_column_size_ = candidate_column_size; | 785 previous_candidate_column_size_ = candidate_column_size; |
786 previous_annotation_column_size_ = annotation_column_size; | 786 previous_annotation_column_size_ = annotation_column_size; |
787 | 787 |
788 // Clear the existing candidate_views if any. | 788 // Clear the existing candidate_views if any. |
789 for (size_t i = 0; i < candidate_views_.size(); ++i) { | 789 for (size_t i = 0; i < candidate_views_.size(); ++i) { |
790 candidate_area_contents->RemoveChildView(candidate_views_[i]); | 790 candidate_area_contents->RemoveChildView(candidate_views_[i]); |
791 // Delete the view after getting out the current message loop iteration. | 791 // Delete the view after getting out the current message loop iteration. |
792 MessageLoop::current()->DeleteSoon(FROM_HERE, candidate_views_[i]); | 792 base::MessageLoop::current()->DeleteSoon(FROM_HERE, candidate_views_[i]); |
793 } | 793 } |
794 candidate_views_.clear(); | 794 candidate_views_.clear(); |
795 selected_candidate_index_in_page_ = -1; // Invalidates the index. | 795 selected_candidate_index_in_page_ = -1; // Invalidates the index. |
796 | 796 |
797 views::GridLayout* layout = new views::GridLayout(candidate_area_contents); | 797 views::GridLayout* layout = new views::GridLayout(candidate_area_contents); |
798 // |candidate_area_contents| owns |layout|. | 798 // |candidate_area_contents| owns |layout|. |
799 candidate_area_contents->SetLayoutManager(layout); | 799 candidate_area_contents->SetLayoutManager(layout); |
800 // Initialize the column set. | 800 // Initialize the column set. |
801 views::ColumnSet* column_set = layout->AddColumnSet(0); | 801 views::ColumnSet* column_set = layout->AddColumnSet(0); |
802 if (orientation == IBusLookupTable::VERTICAL) { | 802 if (orientation == IBusLookupTable::VERTICAL) { |
(...skipping 197 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1000 | 1000 |
1001 void CandidateWindowView::OnBoundsChanged(const gfx::Rect& previous_bounds) { | 1001 void CandidateWindowView::OnBoundsChanged(const gfx::Rect& previous_bounds) { |
1002 // If the bounds(size) of candidate window is changed, | 1002 // If the bounds(size) of candidate window is changed, |
1003 // we should move the frame to the right position. | 1003 // we should move the frame to the right position. |
1004 View::OnBoundsChanged(previous_bounds); | 1004 View::OnBoundsChanged(previous_bounds); |
1005 ResizeAndMoveParentFrame(); | 1005 ResizeAndMoveParentFrame(); |
1006 } | 1006 } |
1007 | 1007 |
1008 } // namespace input_method | 1008 } // namespace input_method |
1009 } // namespace chromeos | 1009 } // namespace chromeos |
OLD | NEW |