OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 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 | 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/views/controls/native/native_view_host_aura.h" | 5 #include "ui/views/controls/native/native_view_host_aura.h" |
6 | 6 |
7 #include "base/logging.h" | 7 #include "base/logging.h" |
8 #include "ui/aura/focus_manager.h" | 8 #include "ui/aura/focus_manager.h" |
9 #include "ui/aura/window.h" | 9 #include "ui/aura/window.h" |
10 #include "ui/views/controls/native/native_view_host.h" | 10 #include "ui/views/controls/native/native_view_host.h" |
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
74 host_->native_view()->SetBounds(gfx::Rect(x, y, w, h)); | 74 host_->native_view()->SetBounds(gfx::Rect(x, y, w, h)); |
75 host_->native_view()->Show(); | 75 host_->native_view()->Show(); |
76 } | 76 } |
77 | 77 |
78 void NativeViewHostAura::HideWidget() { | 78 void NativeViewHostAura::HideWidget() { |
79 host_->native_view()->Hide(); | 79 host_->native_view()->Hide(); |
80 } | 80 } |
81 | 81 |
82 void NativeViewHostAura::SetFocus() { | 82 void NativeViewHostAura::SetFocus() { |
83 aura::Window* window = host_->native_view(); | 83 aura::Window* window = host_->native_view(); |
84 if (window->GetFocusManager()) | 84 aura::client::FocusClient* client = aura::client::GetFocusClient(window); |
85 window->GetFocusManager()->SetFocusedWindow(window, NULL); | 85 if (client) |
| 86 client->FocusWindow(window, NULL); |
86 } | 87 } |
87 | 88 |
88 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() { | 89 gfx::NativeViewAccessible NativeViewHostAura::GetNativeViewAccessible() { |
89 return NULL; | 90 return NULL; |
90 } | 91 } |
91 | 92 |
92 void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) { | 93 void NativeViewHostAura::OnWindowDestroyed(aura::Window* window) { |
93 DCHECK(window == host_->native_view()); | 94 DCHECK(window == host_->native_view()); |
94 host_->NativeViewDestroyed(); | 95 host_->NativeViewDestroyed(); |
95 } | 96 } |
96 | 97 |
97 // static | 98 // static |
98 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 99 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( |
99 NativeViewHost* host) { | 100 NativeViewHost* host) { |
100 return new NativeViewHostAura(host); | 101 return new NativeViewHostAura(host); |
101 } | 102 } |
102 | 103 |
103 } // namespace views | 104 } // namespace views |
OLD | NEW |