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/login/touch_login_view.h" | 5 #include "chrome/browser/chromeos/login/touch_login_view.h" |
6 | 6 |
7 #include "chrome/browser/chromeos/status/status_area_view.h" | 7 #include "chrome/browser/chromeos/status/status_area_view.h" |
8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
9 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" | 9 #include "chrome/browser/renderer_host/render_widget_host_view_views.h" |
10 #include "chrome/browser/ui/touch/frame/keyboard_container_view.h" | 10 #include "chrome/browser/ui/touch/frame/keyboard_container_view.h" |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
113 bool display_keyboard = (keyboard_showing_ || animation_->is_animating()); | 113 bool display_keyboard = (keyboard_showing_ || animation_->is_animating()); |
114 keyboard_->SetVisible(display_keyboard); | 114 keyboard_->SetVisible(display_keyboard); |
115 gfx::Rect keyboard_bounds = bounds(); | 115 gfx::Rect keyboard_bounds = bounds(); |
116 int keyboard_height = display_keyboard ? keyboard_height_ : 0; | 116 int keyboard_height = display_keyboard ? keyboard_height_ : 0; |
117 keyboard_bounds.set_y(keyboard_bounds.height() - keyboard_height); | 117 keyboard_bounds.set_y(keyboard_bounds.height() - keyboard_height); |
118 keyboard_bounds.set_height(keyboard_height); | 118 keyboard_bounds.set_height(keyboard_height); |
119 keyboard_->SetBoundsRect(keyboard_bounds); | 119 keyboard_->SetBoundsRect(keyboard_bounds); |
120 } | 120 } |
121 | 121 |
122 void TouchLoginView::InitStatusArea() { | 122 void TouchLoginView::InitStatusArea() { |
123 DCHECK(status_area_ == NULL); | 123 if (status_area_) |
| 124 return; |
124 status_area_ = new StatusAreaView(this); | 125 status_area_ = new StatusAreaView(this); |
125 status_area_->Init(); | 126 status_area_->Init(); |
126 AddChildView(status_area_); | 127 AddChildView(status_area_); |
127 } | 128 } |
128 | 129 |
129 // TouchLoginView private: ----------------------------------------------------- | 130 // TouchLoginView private: ----------------------------------------------------- |
130 | 131 |
131 void TouchLoginView::InitVirtualKeyboard() { | 132 void TouchLoginView::InitVirtualKeyboard() { |
132 keyboard_ = new KeyboardContainerView(profile_, NULL); | 133 keyboard_ = new KeyboardContainerView(profile_, NULL); |
133 keyboard_->SetVisible(false); | 134 keyboard_->SetVisible(false); |
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 void TouchLoginView::AnimationEnded(const ui::Animation* animation) { | 224 void TouchLoginView::AnimationEnded(const ui::Animation* animation) { |
224 if (keyboard_showing_) { | 225 if (keyboard_showing_) { |
225 Layout(); | 226 Layout(); |
226 } else { | 227 } else { |
227 // Notify the keyboard that it is hidden now. | 228 // Notify the keyboard that it is hidden now. |
228 keyboard_->SetVisible(false); | 229 keyboard_->SetVisible(false); |
229 } | 230 } |
230 } | 231 } |
231 | 232 |
232 } // namespace chromeos | 233 } // namespace chromeos |
OLD | NEW |