| OLD | NEW |
| 1 // Copyright (c) 2013 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2013 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 "ui/keyboard/keyboard_controller.h" | 5 #include "ui/keyboard/keyboard_controller.h" |
| 6 | 6 |
| 7 #include <set> | 7 #include <set> |
| 8 | 8 |
| 9 #include "base/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 274 } | 274 } |
| 275 | 275 |
| 276 aura::Window* KeyboardController::GetContainerWindow() { | 276 aura::Window* KeyboardController::GetContainerWindow() { |
| 277 if (!container_.get()) { | 277 if (!container_.get()) { |
| 278 container_.reset(new aura::Window( | 278 container_.reset(new aura::Window( |
| 279 new KeyboardWindowDelegate(proxy_.get()))); | 279 new KeyboardWindowDelegate(proxy_.get()))); |
| 280 container_->SetEventTargeter(scoped_ptr<ui::EventTargeter>( | 280 container_->SetEventTargeter(scoped_ptr<ui::EventTargeter>( |
| 281 new KeyboardContainerTargeter(container_.get(), proxy_.get()))); | 281 new KeyboardContainerTargeter(container_.get(), proxy_.get()))); |
| 282 container_->SetName("KeyboardContainer"); | 282 container_->SetName("KeyboardContainer"); |
| 283 container_->set_owned_by_parent(false); | 283 container_->set_owned_by_parent(false); |
| 284 container_->Init(aura::WINDOW_LAYER_NOT_DRAWN); | 284 container_->Init(ui::LAYER_NOT_DRAWN); |
| 285 container_->AddObserver(this); | 285 container_->AddObserver(this); |
| 286 container_->SetLayoutManager(new KeyboardLayoutManager(this)); | 286 container_->SetLayoutManager(new KeyboardLayoutManager(this)); |
| 287 } | 287 } |
| 288 return container_.get(); | 288 return container_.get(); |
| 289 } | 289 } |
| 290 | 290 |
| 291 void KeyboardController::NotifyKeyboardBoundsChanging( | 291 void KeyboardController::NotifyKeyboardBoundsChanging( |
| 292 const gfx::Rect& new_bounds) { | 292 const gfx::Rect& new_bounds) { |
| 293 current_keyboard_bounds_ = new_bounds; | 293 current_keyboard_bounds_ = new_bounds; |
| 294 if (proxy_->HasKeyboardWindow() && proxy_->GetKeyboardWindow()->IsVisible()) { | 294 if (proxy_->HasKeyboardWindow() && proxy_->GetKeyboardWindow()->IsVisible()) { |
| (...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 proxy_->HideKeyboardContainer(container_.get()); | 572 proxy_->HideKeyboardContainer(container_.get()); |
| 573 } | 573 } |
| 574 | 574 |
| 575 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) { | 575 void KeyboardController::AddBoundsChangedObserver(aura::Window* window) { |
| 576 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr; | 576 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr; |
| 577 if (target_window) | 577 if (target_window) |
| 578 window_bounds_observer_->AddObservedWindow(target_window); | 578 window_bounds_observer_->AddObservedWindow(target_window); |
| 579 } | 579 } |
| 580 | 580 |
| 581 } // namespace keyboard | 581 } // namespace keyboard |
| OLD | NEW |