Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: ui/views/controls/native/native_view_host_aura.cc

Issue 11299219: Rework FocusManager as FocusClient. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « ui/aura/window.cc ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« no previous file with comments | « ui/aura/window.cc ('k') | ui/views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698