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

Side by Side Diff: chrome/browser/extensions/window_controller_list.h

Issue 10735061: Move ExtensionWindowController and related into extensions namespace (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Latest master for cq Created 8 years, 5 months 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
OLDNEW
(Empty)
1 // Copyright (c) 2012 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_EXTENSIONS_WINDOW_CONTROLLER_LIST_H_
6 #define CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_LIST_H_
7
8 #include <list>
9
10 #include "base/compiler_specific.h"
11 #include "base/memory/singleton.h"
12 #include "chrome/browser/extensions/window_controller.h"
13
14 class Profile;
15 class UIThreadExtensionFunction;
16
17 namespace extensions {
18
19 // Class to maintain a list of WindowControllers.
20 class WindowControllerList {
21 public:
22 typedef std::list<WindowController*> ControllerList;
23
24 WindowControllerList();
25 ~WindowControllerList();
26
27 void AddExtensionWindow(WindowController* window);
28 void RemoveExtensionWindow(WindowController* window);
29
30 // Returns a window matching the context the function was invoked in.
31 WindowController* FindWindowForFunctionById(
32 const UIThreadExtensionFunction* function,
33 int id) const;
34
35 // Returns the focused or last added window matching the context the function
36 // was invoked in.
37 WindowController* CurrentWindowForFunction(
38 const UIThreadExtensionFunction* function) const;
39
40 const ControllerList& windows() const { return windows_; }
41
42 static WindowControllerList* GetInstance();
43
44 private:
45 friend struct DefaultSingletonTraits<WindowControllerList>;
46
47 // Entries are not owned by this class and must be removed when destroyed.
48 ControllerList windows_;
49
50 DISALLOW_COPY_AND_ASSIGN(WindowControllerList);
51 };
52
53 } // namespace extensions
54
55 #endif // CHROME_BROWSER_EXTENSIONS_WINDOW_CONTROLLER_LIST_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/window_controller.cc ('k') | chrome/browser/extensions/window_controller_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698