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

Unified Diff: views/bubble/bubble_delegate.h

Issue 8319008: aura: brightness and volume bubble. (Closed) Base URL: http://git.chromium.org/git/chromium.git@trunk
Patch Set: 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
Index: views/bubble/bubble_delegate.h
diff --git a/views/bubble/bubble_delegate.h b/views/bubble/bubble_delegate.h
index 32cf0a459b6a5fd3cf7ab4e36f04c25a298b8a06..7b34b1619cdc1593fcc8b06b98da417143fb19db 100644
--- a/views/bubble/bubble_delegate.h
+++ b/views/bubble/bubble_delegate.h
@@ -6,56 +6,49 @@
#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 ~BubbleDelegateView();
+
+ // Construct a Bubble Widget from the argument BubbleDelegateView.
+ static Widget* ConstructBubble(BubbleDelegateView* bubble_delegate,
+ Widget* parent_widget);
+
+ // WidgetDelegate overrides:
+ virtual View* GetContentsView() OVERRIDE { return this; }
virtual ClientView* CreateClientView(Widget* widget) OVERRIDE;
virtual NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
- virtual SkColor GetFrameBackgroundColor() = 0;
- virtual gfx::Rect GetBounds() = 0;
- virtual BubbleBorder::ArrowLocation GetFrameArrowLocation() = 0;
+ // Override Init to perform Contents View initialization for bubble sizing.
+ virtual void Init() {}
- const BubbleView* GetBubbleView() const;
- BubbleView* GetBubbleView();
+ // Get the arrow's target point in screen space.
+ virtual gfx::Point GetArrowPoint() const;
- const BubbleFrameView* GetBubbleFrameView() const;
- BubbleFrameView* GetBubbleFrameView();
+ // Get the arrow's location on the bubble.
+ virtual BubbleBorder::ArrowLocation GetArrowLocation() const {
+ return BubbleBorder::TOP_LEFT;
+ }
- protected:
- virtual ~BubbleDelegate() {}
-};
+ // Get the color used for the background and border.
+ virtual SkColor GetColor() const { return SK_ColorWHITE; }
-// 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();
+ virtual bool GetEnableAccelerator() const { return true; }
- // Overridden from WidgetDelegate:
- virtual Widget* GetWidget() OVERRIDE;
- virtual const Widget* GetWidget() const OVERRIDE;
-
- private:
- Widget* frame_;
- DISALLOW_COPY_AND_ASSIGN(BubbleDelegateView);
+ BubbleView* GetBubbleView();
+ BubbleFrameView* GetBubbleFrameView();
};
} // namespace views

Powered by Google App Engine
This is Rietveld 408576698