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

Side by Side Diff: chrome/browser/ui/views/validation_message_bubble_view.h

Issue 2785683003: views: implement width snapping for DialogDelegateViews (Closed)
Patch Set: Created 3 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 unified diff | Download patch
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/weak_ptr.h" 9 #include "base/memory/weak_ptr.h"
10 #include "chrome/browser/ui/validation_message_bubble.h" 10 #include "chrome/browser/ui/validation_message_bubble.h"
(...skipping 10 matching lines...) Expand all
21 : public views::BubbleDialogDelegateView, 21 : public views::BubbleDialogDelegateView,
22 public ValidationMessageBubble, 22 public ValidationMessageBubble,
23 public base::SupportsWeakPtr<ValidationMessageBubbleView> { 23 public base::SupportsWeakPtr<ValidationMessageBubbleView> {
24 public: 24 public:
25 ValidationMessageBubbleView(content::WebContents* web_contents, 25 ValidationMessageBubbleView(content::WebContents* web_contents,
26 const gfx::Rect& anchor_in_root_view, 26 const gfx::Rect& anchor_in_root_view,
27 const base::string16& main_text, 27 const base::string16& main_text,
28 const base::string16& sub_text); 28 const base::string16& sub_text);
29 ~ValidationMessageBubbleView() override; 29 ~ValidationMessageBubbleView() override;
30 30
31 // DialogDelegateView overrides:
32 gfx::Size GetUnsnappedPreferredSize() const override;
Peter Kasting 2017/03/30 00:35:36 Nit: Leave in below list
33
31 // BubbleDialogDelegateView overrides: 34 // BubbleDialogDelegateView overrides:
32 gfx::Size GetPreferredSize() const override;
33 int GetDialogButtons() const override; 35 int GetDialogButtons() const override;
34 36
35 // ValidationMessageBubble overrides: 37 // ValidationMessageBubble overrides:
36 void SetPositionRelativeToAnchor( 38 void SetPositionRelativeToAnchor(
37 content::RenderWidgetHost* widget_host, 39 content::RenderWidgetHost* widget_host,
38 const gfx::Rect& anchor_in_root_view) override; 40 const gfx::Rect& anchor_in_root_view) override;
39 void CloseValidationMessage() override; 41 void CloseValidationMessage() override;
40 42
41 private: 43 private:
42 gfx::Rect RootViewToScreenRect( 44 gfx::Rect RootViewToScreenRect(
43 const gfx::Rect& rect_in_root_view, 45 const gfx::Rect& rect_in_root_view,
44 const content::RenderWidgetHostView* render_widget_host_view) const; 46 const content::RenderWidgetHostView* render_widget_host_view) const;
45 47
46 gfx::Size size_; 48 gfx::Size size_;
47 49
48 DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleView); 50 DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleView);
49 }; 51 };
50 52
51 #endif // CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_ 53 #endif // CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698