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

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

Issue 9428018: Create BaseWindow and ExtensionWindowWrapper for extension API access to Panels (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 9 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_EXTENSION_WINDOW_LIST_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WINDOW_LIST_H_
7 #pragma once
8
9 #include <list>
10
11 #include "base/compiler_specific.h"
12 #include "base/memory/singleton.h"
13 #include "chrome/browser/extensions/extension_window_controller.h"
14
15 class Profile;
16
17 // Class to maintain a list of ExtensionWindowControllers.
18 class ExtensionWindowList {
19 public:
20 typedef std::list<ExtensionWindowController*> WindowList;
21 typedef ExtensionWindowController::ProfileMatchType ProfileMatchType;
22
23 ExtensionWindowList();
24 ~ExtensionWindowList();
25
26 void AddExtensionWindow(ExtensionWindowController* window);
27 void RemoveExtensionWindow(ExtensionWindowController* window);
28
29 // Returns a window matching the profile and id, or NULL.
30 ExtensionWindowController* FindWindowById(Profile* profile,
31 ProfileMatchType match_type,
32 int id) const;
33
34 // Returns the focused or last added window matching the profile, or NULL.
35 ExtensionWindowController* CurrentWindow(Profile* profile,
36 ProfileMatchType match_type) const;
37
38 const WindowList& windows() const { return windows_; }
39
40 static ExtensionWindowList* GetInstance();
41
42 private:
43 friend struct DefaultSingletonTraits<ExtensionWindowList>;
44
45 // Entries are not owned by this class and must be removed when destroyed.
46 WindowList windows_;
47
48 DISALLOW_COPY_AND_ASSIGN(ExtensionWindowList);
49 };
50
51 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WINDOW_LIST_H_
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_window_controller.cc ('k') | chrome/browser/extensions/extension_window_list.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698