| 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 848 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 859 | 859 |
| 860 void CandidateWindowView::ShowAuxiliaryText() { | 860 void CandidateWindowView::ShowAuxiliaryText() { |
| 861 views::View* target_area = ( | 861 views::View* target_area = ( |
| 862 lookup_table_.orientation == InputMethodLookupTable::kHorizontal ? | 862 lookup_table_.orientation == InputMethodLookupTable::kHorizontal ? |
| 863 header_area_ : footer_area_); | 863 header_area_ : footer_area_); |
| 864 views::View* target_contents = ( | 864 views::View* target_contents = ( |
| 865 lookup_table_.orientation == InputMethodLookupTable::kHorizontal ? | 865 lookup_table_.orientation == InputMethodLookupTable::kHorizontal ? |
| 866 header_area_contents_.get() : | 866 header_area_contents_.get() : |
| 867 footer_area_contents_.get()); | 867 footer_area_contents_.get()); |
| 868 | 868 |
| 869 if (!target_area->HasChildView(target_contents)) { | 869 if (target_contents->parent() != target_area) { |
| 870 // If contents not in display area, put it in. | 870 // If contents not in display area, put it in. |
| 871 target_area->RemoveAllChildViews(false); // Don't delete child views. | 871 target_area->RemoveAllChildViews(false); // Don't delete child views. |
| 872 target_area->AddChildView(target_contents); | 872 target_area->AddChildView(target_contents); |
| 873 } | 873 } |
| 874 } | 874 } |
| 875 | 875 |
| 876 void CandidateWindowView::UpdateAuxiliaryText(const std::string& utf8_text) { | 876 void CandidateWindowView::UpdateAuxiliaryText(const std::string& utf8_text) { |
| 877 views::Label* target_label = ( | 877 views::Label* target_label = ( |
| 878 lookup_table_.orientation == InputMethodLookupTable::kHorizontal ? | 878 lookup_table_.orientation == InputMethodLookupTable::kHorizontal ? |
| 879 header_label_ : footer_label_); | 879 header_label_ : footer_label_); |
| (...skipping 538 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1418 | 1418 |
| 1419 CandidateWindowController::~CandidateWindowController() { | 1419 CandidateWindowController::~CandidateWindowController() { |
| 1420 delete impl_; | 1420 delete impl_; |
| 1421 } | 1421 } |
| 1422 | 1422 |
| 1423 bool CandidateWindowController::Init() { | 1423 bool CandidateWindowController::Init() { |
| 1424 return impl_->Init(); | 1424 return impl_->Init(); |
| 1425 } | 1425 } |
| 1426 | 1426 |
| 1427 } // namespace chromeos | 1427 } // namespace chromeos |
| OLD | NEW |