Pin Chrome's shortcut to the Win10 Start menu on install and OS upgrade.
[chromium-blink-merge.git] / ui / views / focus / focus_manager_factory.h
blob6f13b2477874a5275fee173637a1089851826cea
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"
11 namespace views {
13 class FocusManager;
14 class Widget;
16 // A factory to create FocusManager. This is used in unit tests
17 // to inject a custom factory.
18 class VIEWS_EXPORT FocusManagerFactory {
19 public:
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);
27 protected:
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;
37 private:
38 DISALLOW_COPY_AND_ASSIGN(FocusManagerFactory);
41 } // namespace views
43 #endif // UI_VIEWS_FOCUS_FOCUS_MANAGER_FACTORY_H_