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

Unified Diff: views/bubble/bubble_delegate.h

Issue 8227003: Views Bubble API adjustments and cleanup (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 9 years, 2 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
« no previous file with comments | « views/bubble/bubble_border.cc ('k') | views/bubble/bubble_delegate.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/bubble/bubble_delegate.h
diff --git a/views/bubble/bubble_delegate.h b/views/bubble/bubble_delegate.h
index 32cf0a459b6a5fd3cf7ab4e36f04c25a298b8a06..4885dff7bcdce0bb53633df8abdc082691ac80c7 100644
--- a/views/bubble/bubble_delegate.h
+++ b/views/bubble/bubble_delegate.h
@@ -6,56 +6,47 @@
#define VIEWS_BUBBLE_BUBBLE_DELEGATE_H_
#pragma once
-#include <string>
-
#include "views/bubble/bubble_border.h"
-#include "views/view.h"
#include "views/widget/widget_delegate.h"
namespace views {
-class BubbleBorder;
+
class BubbleFrameView;
class BubbleView;
-class View;
-// BubbleDelegate interface to create bubble frame view and bubble client view.
+// BubbleDelegateView creates frame and client views for bubble Widgets.
+// BubbleDelegateView itself is the client's contents view.
//
///////////////////////////////////////////////////////////////////////////////
-class VIEWS_EXPORT BubbleDelegate : public WidgetDelegate {
+class VIEWS_EXPORT BubbleDelegateView : public WidgetDelegateView {
public:
- virtual BubbleDelegate* AsBubbleDelegate() OVERRIDE;
- virtual ClientView* CreateClientView(Widget* widget) OVERRIDE;
- virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
+ virtual ~BubbleDelegateView();
- virtual SkColor GetFrameBackgroundColor() = 0;
- virtual gfx::Rect GetBounds() = 0;
- virtual BubbleBorder::ArrowLocation GetFrameArrowLocation() = 0;
+ // Construct a Bubble Widget from the argument BubbleDelegateView.
+ static Widget* ConstructBubble(BubbleDelegateView* bubble_delegate,
+ Widget* parent_widget);
- const BubbleView* GetBubbleView() const;
- BubbleView* GetBubbleView();
+ // WidgetDelegate overrides:
+ virtual View* GetContentsView() OVERRIDE { return this; }
+ virtual ClientView* CreateClientView(Widget* widget) OVERRIDE;
+ virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
- const BubbleFrameView* GetBubbleFrameView() const;
- BubbleFrameView* GetBubbleFrameView();
+ // Override Init to perform Contents View initialization for bubble sizing.
+ virtual void Init() {}
- protected:
- virtual ~BubbleDelegate() {}
-};
+ // Get the arrow's target point in screen space.
+ virtual gfx::Point GetArrowPoint() const;
alicet1 2011/10/14 00:21:17 Is this the same as the anchor point? if so can it
-// BubbleDelegateView to create bubble frame view and bubble client view.
-//
-///////////////////////////////////////////////////////////////////////////////
-class VIEWS_EXPORT BubbleDelegateView : public BubbleDelegate, public View {
- public:
- explicit BubbleDelegateView(Widget* frame);
- virtual ~BubbleDelegateView();
+ // Get the arrow's location on the bubble.
+ virtual BubbleBorder::ArrowLocation GetArrowLocation() const {
+ return BubbleBorder::TOP_LEFT;
+ }
- // Overridden from WidgetDelegate:
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
+ // Get the color used for the background and border.
+ virtual SkColor GetColor() const { return SK_ColorWHITE; }
- private:
- Widget* frame_;
- DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView);
+ BubbleView* GetBubbleView();
+ BubbleFrameView* GetBubbleFrameView();
};
} // namespace views
« no previous file with comments | « views/bubble/bubble_border.cc ('k') | views/bubble/bubble_delegate.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698