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

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: msw review 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..b496b5bbb7a7200b28f3b5c97229f5045f40f7ad 100644
--- a/chrome/browser/ui/views/validation_message_bubble_view.h
+++ b/chrome/browser/ui/views/validation_message_bubble_view.h
@@ -6,8 +6,10 @@
#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/gfx/geometry/size.h"
+#include "ui/views/bubble/bubble_dialog_delegate.h"
namespace content {
class WebContents;
@@ -15,8 +17,9 @@ class WebContents;
// A ValidationMessageBubble implementation for Views.
class ValidationMessageBubbleView
- : public ValidationMessageBubble,
- public ValidationMessageBubbleDelegate::Observer {
+ : public views::BubbleDialogDelegateView,
+ public ValidationMessageBubble,
+ public base::SupportsWeakPtr<ValidationMessageBubbleView> {
public:
ValidationMessageBubbleView(content::WebContents* web_contents,
const gfx::Rect& anchor_in_root_view,
@@ -24,16 +27,18 @@ class ValidationMessageBubbleView
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_;
+ gfx::Size size_;
DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleView);
};

Powered by Google App Engine
This is Rietveld 408576698