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

Unified Diff: chrome/browser/ui/views/confirm_bubble_views.h

Issue 12222003: Rebase ConfirmBubbleViews on DialogDelegateView. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Sync and rebase to retry CQ. 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
Index: chrome/browser/ui/views/confirm_bubble_views.h
diff --git a/chrome/browser/ui/views/confirm_bubble_views.h b/chrome/browser/ui/views/confirm_bubble_views.h
index 69462bb188626d3734b12a2dff13c1f15e650726..aa6e06cd3baa5b4b79bdd2274b18e766a680fb31 100644
--- a/chrome/browser/ui/views/confirm_bubble_views.h
+++ b/chrome/browser/ui/views/confirm_bubble_views.h
@@ -7,57 +7,49 @@
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "ui/views/bubble/bubble_delegate.h"
-#include "ui/views/controls/button/button.h"
#include "ui/views/controls/link_listener.h"
+#include "ui/views/window/dialog_delegate.h"
class ConfirmBubbleModel;
-// A class that implements a bubble that consists of the following items:
-// * one icon ("icon")
-// * one title text ("title")
-// * one message text ("message")
-// * one optional link ("link")
-// * two optional buttons ("ok" and "cancel")
-//
-// This bubble is convenient when we wish to ask transient, non-blocking
-// questions. Unlike a dialog, a bubble menu disappears when we click outside of
-// its window to avoid blocking user operations. A bubble is laid out as
-// follows:
-//
+// A dialog (with the standard Title/(x)/[OK]/[Cancel] UI elements), as well as
+// a message Label and optional Link. The dialog ultimately appears like this:
// +------------------------+
-// | icon title x |
-// | message |
-// | link |
-// | [OK] [Cancel] |
+// | Title (x) |
+// | Label |
+// | Link [OK] [Cancel] |
// +------------------------+
//
-class ConfirmBubbleViews : public views::BubbleDelegateView,
- public views::ButtonListener,
+// TODO(msw): Remove this class or merge it with DialogDelegateView.
+class ConfirmBubbleViews : public views::DialogDelegateView,
public views::LinkListener {
public:
- ConfirmBubbleViews(gfx::NativeView parent,
- const gfx::Point& anchor_point,
- ConfirmBubbleModel* model);
+ explicit ConfirmBubbleViews(ConfirmBubbleModel* model);
protected:
virtual ~ConfirmBubbleViews();
- // views::ButtonListener implementation.
- virtual void ButtonPressed(views::Button* sender,
- const ui::Event& event) OVERRIDE;
+ // views::DialogDelegate implementation.
+ virtual string16 GetDialogButtonLabel(ui::DialogButton button) const OVERRIDE;
+ virtual bool IsDialogButtonEnabled(ui::DialogButton button) const OVERRIDE;
+ virtual bool IsDialogButtonVisible(ui::DialogButton button) const OVERRIDE;
+ virtual views::View* GetExtraView() OVERRIDE;
+ virtual bool Cancel() OVERRIDE;
+ virtual bool Accept() OVERRIDE;
+
+ // views::WidgetDelegate implementation.
+ virtual ui::ModalType GetModalType() const OVERRIDE;
+ virtual string16 GetWindowTitle() const OVERRIDE;
// views::LinkListener implementation.
virtual void LinkClicked(views::Link* source, int event_flags) OVERRIDE;
- // views::BubbleDelegateView implementation.
- virtual gfx::Rect GetAnchorRect() OVERRIDE;
- virtual void Init() OVERRIDE;
-
private:
// The model to customize this bubble view.
scoped_ptr<ConfirmBubbleModel> model_;
+ views::Link* link_;
+
DISALLOW_COPY_AND_ASSIGN(ConfirmBubbleViews);
};
« no previous file with comments | « chrome/browser/tab_contents/spelling_menu_observer.cc ('k') | chrome/browser/ui/views/confirm_bubble_views.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698