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

Side by Side Diff: views/focus/focus_manager_factory.cc

Issue 8588064: views: Move bubble, events, focus and layout to ui/views/. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 1 month 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 | « views/focus/focus_manager_factory.h ('k') | 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
(Empty)
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.
4
5 #include "views/focus/focus_manager_factory.h"
6
7 #include "base/compiler_specific.h"
8 #include "views/focus/focus_manager.h"
9
10 namespace {
11
12 using views::FocusManager;
13
14 class DefaultFocusManagerFactory : public views::FocusManagerFactory {
15 public:
16 DefaultFocusManagerFactory() : views::FocusManagerFactory() {}
17 virtual ~DefaultFocusManagerFactory() {}
18
19 protected:
20 virtual FocusManager* CreateFocusManager(views::Widget* widget) OVERRIDE {
21 return new FocusManager(widget);
22 }
23
24 private:
25 DISALLOW_COPY_AND_ASSIGN(DefaultFocusManagerFactory);
26 };
27
28 views::FocusManagerFactory* focus_manager_factory = NULL;
29
30 } // namespace
31
32 namespace views {
33
34 FocusManagerFactory::FocusManagerFactory() {
35 }
36
37 FocusManagerFactory::~FocusManagerFactory() {
38 }
39
40 // static
41 FocusManager* FocusManagerFactory::Create(Widget* widget) {
42 if (!focus_manager_factory)
43 focus_manager_factory = new DefaultFocusManagerFactory();
44 return focus_manager_factory->CreateFocusManager(widget);
45 }
46
47 // static
48 void FocusManagerFactory::Install(FocusManagerFactory* f) {
49 if (f == focus_manager_factory)
50 return;
51 delete focus_manager_factory;
52 focus_manager_factory = f ? f : new DefaultFocusManagerFactory();
53 }
54
55 } // namespace views
OLDNEW
« no previous file with comments | « views/focus/focus_manager_factory.h ('k') | views/focus/focus_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698