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
3 // found in the LICENSE file.
5 #include "chrome/browser/ui/views/native_focus_tracker_views.h"
7 NativeFocusTrackerViews::NativeFocusTrackerViews(NativeFocusTrackerHost
* host
)
9 views::WidgetFocusManager::GetInstance()->AddFocusChangeListener(this);
12 NativeFocusTrackerViews::~NativeFocusTrackerViews() {
13 views::WidgetFocusManager::GetInstance()->RemoveFocusChangeListener(this);
16 void NativeFocusTrackerViews::OnNativeFocusChange(
17 gfx::NativeView focused_before
,
18 gfx::NativeView focused_now
) {
19 host_
->SetBrowser(GetBrowserForNativeView(focused_now
));
23 NativeFocusTracker
* NativeFocusTracker::Create(NativeFocusTrackerHost
* host
) {
24 return new NativeFocusTrackerViews(host
);