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. 4 5 #ifndef CHROME_BROWSER_UI_NATIVE_FOCUS_TRACKER_H_ 6 #define CHROME_BROWSER_UI_NATIVE_FOCUS_TRACKER_H_ 7 8 #include "base/basictypes.h" 9 10 class Browser; 11 12 // NativeFocusTracker is responsible for tracking changes to the active Browser 13 // and notifying NativeFocusTrackerHost of these changes. If a non-Browser 14 // window becomes active SetBrowser(NULL) should be invoked. 15 // 16 // ActiveTabTracker creates a NativeFocusTracker. 17 class NativeFocusTrackerHost { 18 public: 19 virtual void SetBrowser(Browser* browser) = 0; 20 21 protected: 22 virtual ~NativeFocusTrackerHost() {} 23 }; 24 25 class NativeFocusTracker { 26 public: 27 virtual ~NativeFocusTracker() {} 28 29 // Factory method, caller owns returned object. 30 static NativeFocusTracker* Create(NativeFocusTrackerHost* host); 31 32 protected: 33 NativeFocusTracker() {} 34 35 private: 36 DISALLOW_COPY_AND_ASSIGN(NativeFocusTracker); 37 }; 38 39 #endif // CHROME_BROWSER_UI_NATIVE_FOCUS_TRACKER_H_ 40