summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/browser_bubble.h
diff options
context:
space:
mode:
authorerikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 23:00:09 +0000
committererikkay@google.com <erikkay@google.com@0039d316-1c4b-4281-b951-d872f2087c98>2009-06-03 23:00:09 +0000
commit41291b0e3555aa77d3501c02a75679b1d734d4ee (patch)
tree07a73989105d161f7a02cd7f9d87ca14827005a3 /chrome/browser/views/browser_bubble.h
parent5e9877eb405ec97622d419a146b9b7c331568bf6 (diff)
downloadchromium_src-41291b0e3555aa77d3501c02a75679b1d734d4ee.zip
chromium_src-41291b0e3555aa77d3501c02a75679b1d734d4ee.tar.gz
chromium_src-41291b0e3555aa77d3501c02a75679b1d734d4ee.tar.bz2
Part 1 of dragging extensions on the shelf. This part was just about getting the mechanics of the shelf handle and the dragging correct. Part 2 will actually allow the order to be changed.TEST=hover over an extension toolstrip, grab the handle and drag. release.
Review URL: http://codereview.chromium.org/119103 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@17559 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/browser_bubble.h')
-rw-r--r--chrome/browser/views/browser_bubble.h22
1 files changed, 18 insertions, 4 deletions
diff --git a/chrome/browser/views/browser_bubble.h b/chrome/browser/views/browser_bubble.h
index 49ce7fe..702fb1b 100644
--- a/chrome/browser/views/browser_bubble.h
+++ b/chrome/browser/views/browser_bubble.h
@@ -30,6 +30,15 @@ class BrowserBubble {
const gfx::Point& origin);
virtual ~BrowserBubble();
+ // Call manually if you need to detach the bubble from tracking the browser's
+ // position. Note that you must call this manually before deleting this
+ // object since it can't be safely called from the destructor.
+ void DetachFromBrowser();
+
+ // Normally called automatically during construction, but if DetachFromBrowser
+ // has been called manually, then this call will reattach.
+ void AttachToBrowser();
+
// Get/Set the delegate.
Delegate* delegate() const { return delegate_; }
void set_delegate(Delegate* del) { delegate_ = del; }
@@ -49,6 +58,7 @@ class BrowserBubble {
// Set the bounds of the bubble relative to the browser window.
void SetBounds(int x, int y, int w, int h);
+ void MoveTo(int x, int y);
int width() { return bounds_.width(); }
int height() { return bounds_.height(); }
@@ -56,24 +66,25 @@ class BrowserBubble {
// we have to manually position it when the browser window moves.
void Reposition();
+ // Resize the bubble to fit the view.
+ void ResizeToView();
+
protected:
// Create the popup widget.
virtual void InitPopup();
- // Destroy the popup widget.
- virtual void DestroyPopup();
-
// Move the popup to an absolute position.
void MovePopup(int x, int y, int w, int h);
private:
// The frame that this bubble is attached to.
views::Widget* frame_;
+ gfx::NativeView frame_native_view_;
// The view that is displayed in this bubble.
views::View* view_;
- // The actual widget that this bubble is in.
+ // The widget that this bubble is in.
scoped_ptr<views::Widget> popup_;
// The bounds relative to the frame.
@@ -85,6 +96,9 @@ class BrowserBubble {
// The delegate isn't owned by the bubble.
Delegate* delegate_;
+ // Is the bubble attached to a Browser window.
+ bool attached_;
+
DISALLOW_COPY_AND_ASSIGN(BrowserBubble);
};