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

Unified Diff: chrome/browser/ui/panels/panel.h

Issue 10790062: [Panels refactor] Track Panels in TaskManager now that they are not under the tab contents umbrella. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix tests 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel.h
diff --git a/chrome/browser/ui/panels/panel.h b/chrome/browser/ui/panels/panel.h
index 4a3d15db8a1e7e5c98bd76e2f9728746f7db8b03..e2afe1ddd02ae7ade18af8a89a42fbbe178a07a6 100644
--- a/chrome/browser/ui/panels/panel.h
+++ b/chrome/browser/ui/panels/panel.h
@@ -9,6 +9,7 @@
#include "base/gtest_prod_util.h"
#include "base/memory/scoped_ptr.h"
+#include "base/property_bag.h"
#include "base/string16.h"
#include "chrome/browser/command_updater.h"
#include "chrome/browser/sessions/session_id.h"
@@ -69,6 +70,14 @@ class Panel : public BaseWindow,
virtual ~Panel();
+ // Helper to retrieve the existing instance that owns a given WebContents.
+ // Returns NULL if there is no such existing instance.
+ // NOTE: This is not intended for general use. It is intended for situations
+ // like callbacks from content, where only a WebContents is available. In the
+ // general case, please do NOT use this; plumb Panels through the chrome/
+ // code instead of WebContents.
+ static Panel* FromWebContents(content::WebContents* contents);
+
// Returns the PanelManager associated with this panel.
PanelManager* manager() const;
@@ -310,6 +319,10 @@ class Panel : public BaseWindow,
friend class PanelBrowserTest;
friend class OldPanelBrowserTest;
+ // Used to retrieve this object from the web_contents, which is placed in
+ // the web contents property bag to avoid adding additional interfaces.
+ static base::PropertyAccessor<Panel*>* property_accessor();
+
enum MaxSizePolicy {
// Default maximum size is proportional to the work area.
DEFAULT_MAX_SIZE,

Powered by Google App Engine
This is Rietveld 408576698