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

Unified Diff: ui/views/bubble/bubble_frame_view.h

Issue 12184004: Replace DialogFrameView with an enhanced BubbleFrameView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 7 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.cc ('k') | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/views/bubble/bubble_frame_view.h
diff --git a/ui/views/bubble/bubble_frame_view.h b/ui/views/bubble/bubble_frame_view.h
index 03b6db7b0c59dd7e123b36464230a41ca9f37345..45451a4e0fa7c4494a518fee2caa301f80d35eae 100644
--- a/ui/views/bubble/bubble_frame_view.h
+++ b/ui/views/bubble/bubble_frame_view.h
@@ -9,16 +9,19 @@
#include "base/compiler_specific.h"
#include "base/gtest_prod_util.h"
#include "ui/gfx/insets.h"
+#include "ui/views/controls/button/button.h"
#include "ui/views/window/non_client_view.h"
namespace views {
+class Label;
+class LabelButton;
class BubbleBorder;
// The non-client frame view of bubble-styled widgets.
-class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView {
+class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView,
+ public ButtonListener {
public:
-
explicit BubbleFrameView(const gfx::Insets& content_margins);
virtual ~BubbleFrameView();
@@ -28,13 +31,19 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView {
const gfx::Rect& client_bounds) const OVERRIDE;
virtual int NonClientHitTest(const gfx::Point& point) OVERRIDE;
virtual void GetWindowMask(const gfx::Size& size,
- gfx::Path* window_mask) OVERRIDE {}
- virtual void ResetWindowControls() OVERRIDE {}
- virtual void UpdateWindowIcon() OVERRIDE {}
- virtual void UpdateWindowTitle() OVERRIDE {}
+ gfx::Path* window_mask) OVERRIDE;
+ virtual void ResetWindowControls() OVERRIDE;
+ virtual void UpdateWindowIcon() OVERRIDE;
+ virtual void UpdateWindowTitle() OVERRIDE;
// View overrides:
+ virtual gfx::Insets GetInsets() const OVERRIDE;
virtual gfx::Size GetPreferredSize() OVERRIDE;
+ virtual void Layout() OVERRIDE;
+ virtual std::string GetClassName() const OVERRIDE;
+
+ // Overridden from ButtonListener:
+ virtual void ButtonPressed(Button* sender, const ui::Event& event) OVERRIDE;
// Use bubble_border() and SetBubbleBorder(), not border() and set_border().
BubbleBorder* bubble_border() const { return bubble_border_; }
@@ -42,6 +51,11 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView {
gfx::Insets content_margins() const { return content_margins_; }
+ void SetTitle(const string16& title);
+ void SetShowCloseButton(bool show);
+
+ void set_can_drag(bool can_drag) { can_drag_ = can_drag; }
+
// Given the size of the contents and the rect to point at, returns the bounds
// of the bubble window. The bubble's arrow location may change if the bubble
// does not fit on the monitor and |adjust_if_offscreen| is true.
@@ -74,6 +88,13 @@ class VIEWS_EXPORT BubbleFrameView : public NonClientFrameView {
// Margins between the content and the inside of the border, in pixels.
gfx::Insets content_margins_;
+ // The optional title and (x) close button.
+ Label* title_;
+ LabelButton* close_;
+
+ // A flag controlling the ability to drag this frame.
+ bool can_drag_;
+
DISALLOW_COPY_AND_ASSIGN(BubbleFrameView);
};
« no previous file with comments | « chrome/browser/ui/views/constrained_window_views.cc ('k') | ui/views/bubble/bubble_frame_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698