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/content/keyboard_ui_content.h" | 5 #include "ui/keyboard/content/keyboard_ui_content.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/macros.h" | 8 #include "base/macros.h" |
9 #include "base/values.h" | 9 #include "base/values.h" |
10 #include "content/public/browser/render_widget_host.h" | 10 #include "content/public/browser/render_widget_host.h" |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 keyboard_contents_->SetDelegate(new KeyboardContentsDelegate(this)); | 194 keyboard_contents_->SetDelegate(new KeyboardContentsDelegate(this)); |
195 SetupWebContents(keyboard_contents_.get()); | 195 SetupWebContents(keyboard_contents_.get()); |
196 LoadContents(GetVirtualKeyboardUrl()); | 196 LoadContents(GetVirtualKeyboardUrl()); |
197 keyboard_contents_->GetNativeView()->AddObserver(this); | 197 keyboard_contents_->GetNativeView()->AddObserver(this); |
198 } | 198 } |
199 | 199 |
200 return keyboard_contents_->GetNativeView(); | 200 return keyboard_contents_->GetNativeView(); |
201 } | 201 } |
202 | 202 |
203 bool KeyboardUIContent::HasKeyboardWindow() const { | 203 bool KeyboardUIContent::HasKeyboardWindow() const { |
204 return keyboard_contents_; | 204 return !!keyboard_contents_; |
205 } | 205 } |
206 | 206 |
207 bool KeyboardUIContent::ShouldWindowOverscroll(aura::Window* window) const { | 207 bool KeyboardUIContent::ShouldWindowOverscroll(aura::Window* window) const { |
208 return true; | 208 return true; |
209 } | 209 } |
210 | 210 |
211 void KeyboardUIContent::ReloadKeyboardIfNeeded() { | 211 void KeyboardUIContent::ReloadKeyboardIfNeeded() { |
212 DCHECK(keyboard_contents_); | 212 DCHECK(keyboard_contents_); |
213 if (keyboard_contents_->GetURL() != GetVirtualKeyboardUrl()) { | 213 if (keyboard_contents_->GetURL() != GetVirtualKeyboardUrl()) { |
214 if (keyboard_contents_->GetURL().GetOrigin() != | 214 if (keyboard_contents_->GetURL().GetOrigin() != |
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
323 keyboard_controller()->keyboard_visible()); | 323 keyboard_controller()->keyboard_visible()); |
324 } | 324 } |
325 | 325 |
326 void KeyboardUIContent::AddBoundsChangedObserver(aura::Window* window) { | 326 void KeyboardUIContent::AddBoundsChangedObserver(aura::Window* window) { |
327 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr; | 327 aura::Window* target_window = window ? window->GetToplevelWindow() : nullptr; |
328 if (target_window) | 328 if (target_window) |
329 window_bounds_observer_->AddObservedWindow(target_window); | 329 window_bounds_observer_->AddObservedWindow(target_window); |
330 } | 330 } |
331 | 331 |
332 } // namespace keyboard | 332 } // namespace keyboard |
OLD | NEW |