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

Side by Side Diff: chrome/browser/extensions/extension_window_controller.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: Address comments, rename -> ExtensionWindowController Created 8 years, 10 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_CONTROLLER_H_
6 #define CHROME_BROWSER_EXTENSIONS_EXTENSION_WINDOW_CONTROLLER_H_
7 #pragma once
8
9 #include "base/basictypes.h"
10 #include "base/compiler_specific.h"
11
12 class BaseWindow;
13 class GURL;
14 class Profile;
15 class SessionID;
16
17 namespace base {
18 class DictionaryValue;
19 }
20
21 // This API needs to be implemented by any window that might be accessed
22 // through chrome.windows or chrome.tabs (e.g. browser windows and panels).
23 class ExtensionWindowController {
24 public:
25 enum Reason {
26 REASON_NONE,
27 REASON_TAB_STRIP_NOT_EDITABLE,
28 };
29
30 ExtensionWindowController(BaseWindow* window, Profile* profile);
31
32 BaseWindow* window() const { return window_; }
33
34 // Returns true if the window matches the profile.
35 virtual bool MatchesProfile(Profile* profile, bool allow_incognito) const;
36
37 // Return a session id uniquely identifying the window.
38 virtual const SessionID& GetSessionId() const = 0;
39
40 // Populates a dictionary for the Window object.
41 virtual base::DictionaryValue* CreateWindowValue() const = 0;
42
43 // Populates a dictionary for the Window object, including a list of tabs.
44 virtual base::DictionaryValue* CreateWindowValueWithTabs() const = 0;
45
46 // Returns false if the window is in a state where closing the window is not
47 // permitted and sets |reason| if not NULL.
48 virtual bool CanClose(Reason* reason) const = 0;
49
50 // Set the window's fullscreen state. |extension_url| provides the url
51 // associated with the extension (used by FullscreenController).
52 virtual void SetFullscreenMode(
53 bool is_fullscreen, const GURL& extension_url) const = 0;
54
55 private:
56 BaseWindow* window_;
57 Profile* profile_;
58
59 DISALLOW_COPY_AND_ASSIGN(ExtensionWindowController);
60 };
61
62 #endif // CHROME_BROWSER_EXTENSIONS_EXTENSION_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698