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

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

Issue 1880853002: Convert ValidationMessageBubbleView to BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: void Created 4 years, 8 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/validation_message_bubble_view.h
diff --git a/chrome/browser/ui/views/validation_message_bubble_view.h b/chrome/browser/ui/views/validation_message_bubble_view.h
index 3d2f3a05fdbcc8372dcbf86df43fb0e98ea381b5..9e1a71d8de6df4ee41d0975a404fa00ad20e9f20 100644
--- a/chrome/browser/ui/views/validation_message_bubble_view.h
+++ b/chrome/browser/ui/views/validation_message_bubble_view.h
@@ -6,8 +6,9 @@
#define CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_
#include "base/macros.h"
+#include "base/memory/weak_ptr.h"
#include "chrome/browser/ui/validation_message_bubble.h"
-#include "chrome/browser/ui/views/validation_message_bubble_delegate.h"
+#include "ui/views/bubble/bubble_dialog_delegate.h"
namespace content {
class WebContents;
@@ -15,26 +16,32 @@ class WebContents;
// A ValidationMessageBubble implementation for Views.
class ValidationMessageBubbleView
- : public ValidationMessageBubble,
- public ValidationMessageBubbleDelegate::Observer {
+ : public views::BubbleDialogDelegateView,
+ public ValidationMessageBubble,
+ public base::SupportsWeakPtr<ValidationMessageBubbleView> {
public:
+ static const int kWindowMinWidth;
msw 2016/04/14 01:51:38 Can these be moved to the cc file if you're removi
Evan Stade 2016/04/18 01:16:43 Done.
+ static const int kWindowMaxWidth;
+
ValidationMessageBubbleView(content::WebContents* web_contents,
const gfx::Rect& anchor_in_root_view,
const base::string16& main_text,
const base::string16& sub_text);
~ValidationMessageBubbleView() override;
+ // BubbleDialogDelegateView overrides:
+ gfx::Size GetPreferredSize() const override;
+ int GetDialogButtons() const override;
+
// ValidationMessageBubble overrides:
void SetPositionRelativeToAnchor(
content::RenderWidgetHost* widget_host,
const gfx::Rect& anchor_in_root_view) override;
-
- // ValidationMessageBubbleDelegate::Observer overrides:
- void WindowClosing() override;
+ void CloseValidationMessage() override;
private:
- ValidationMessageBubbleDelegate* delegate_;
-
+ int width_;
msw 2016/04/14 01:51:38 nit: gfx::Size?
Evan Stade 2016/04/18 01:16:43 Done.
+ int height_;
DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleView);
msw 2016/04/14 01:51:38 nit: blank line above?
Evan Stade 2016/04/18 01:16:43 Done.
};

Powered by Google App Engine
This is Rietveld 408576698