Revert 168224 - Update V8 to version 3.15.4.
[chromium-blink-merge.git] / chrome / browser / chromeos / input_method / hidable_area.cc
blob9c396c7d6768119b2fcf048dd4ed0c9635d24bbb
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
3 // found in the LICENSE file.
5 #include "chrome/browser/chromeos/input_method/hidable_area.h"
7 #include "ui/views/layout/fill_layout.h"
9 namespace chromeos {
10 namespace input_method {
12 HidableArea::HidableArea() {
13 place_holder_.reset(new views::View);
14 place_holder_->set_owned_by_client(); // Won't own
16 // Initially show nothing.
17 SetLayoutManager(new views::FillLayout);
18 AddChildView(place_holder_.get());
21 HidableArea::~HidableArea() {
24 void HidableArea::SetContents(views::View* contents) {
25 contents_.reset(contents);
26 contents_->set_owned_by_client(); // Won't own
29 void HidableArea::Show() {
30 if (contents_.get() && contents_->parent() != this) {
31 RemoveAllChildViews(false); // Don't delete child views.
32 AddChildView(contents_.get());
36 void HidableArea::Hide() {
37 if (IsShown()) {
38 RemoveAllChildViews(false); // Don't delete child views.
39 AddChildView(place_holder_.get());
43 bool HidableArea::IsShown() const {
44 return contents_.get() && contents_->parent() == this;
47 } // namespace input_method
48 } // namespace chromeos