1 // Copyright (c) 2011 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 #ifndef UI_VIEWS_FOCUS_FOCUS_MANAGER_FACTORY_H_
6 #define UI_VIEWS_FOCUS_FOCUS_MANAGER_FACTORY_H_
8 #include "base/basictypes.h"
9 #include "ui/views/views_export.h"
16 // A factory to create FocusManager. This is used in unit tests
17 // to inject a custom factory.
18 class VIEWS_EXPORT FocusManagerFactory
{
20 // Create a FocusManager for the given |widget| using installe Factory.
21 static FocusManager
* Create(Widget
* widget
, bool desktop_widget
);
23 // Installs FocusManagerFactory. If |factory| is NULL, it resets
24 // to the default factory which creates plain FocusManager.
25 static void Install(FocusManagerFactory
* factory
);
28 FocusManagerFactory();
29 virtual ~FocusManagerFactory();
31 // Create a FocusManager for the given |widget|.
32 // The |desktop_widget| bool is true for widgets created in the desktop and
33 // false for widgets created in the shell.
34 virtual FocusManager
* CreateFocusManager(Widget
* widget
,
35 bool desktop_widget
) = 0;
38 DISALLOW_COPY_AND_ASSIGN(FocusManagerFactory
);
43 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_FACTORY_H_