| OLD | NEW |
| 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" |
| 11 #include "content/public/browser/render_widget_host_view.h" |
| 11 #include "ui/gfx/geometry/size.h" | 12 #include "ui/gfx/geometry/size.h" |
| 12 #include "ui/views/bubble/bubble_dialog_delegate.h" | 13 #include "ui/views/bubble/bubble_dialog_delegate.h" |
| 13 | 14 |
| 14 namespace content { | 15 namespace content { |
| 15 class WebContents; | 16 class WebContents; |
| 16 } | 17 } |
| 17 | 18 |
| 18 // A ValidationMessageBubble implementation for Views. | 19 // A ValidationMessageBubble implementation for Views. |
| 19 class ValidationMessageBubbleView | 20 class ValidationMessageBubbleView |
| 20 : public views::BubbleDialogDelegateView, | 21 : public views::BubbleDialogDelegateView, |
| (...skipping 10 matching lines...) Expand all Loading... |
| 31 gfx::Size GetPreferredSize() const override; | 32 gfx::Size GetPreferredSize() const override; |
| 32 int GetDialogButtons() const override; | 33 int GetDialogButtons() const override; |
| 33 | 34 |
| 34 // ValidationMessageBubble overrides: | 35 // ValidationMessageBubble overrides: |
| 35 void SetPositionRelativeToAnchor( | 36 void SetPositionRelativeToAnchor( |
| 36 content::RenderWidgetHost* widget_host, | 37 content::RenderWidgetHost* widget_host, |
| 37 const gfx::Rect& anchor_in_root_view) override; | 38 const gfx::Rect& anchor_in_root_view) override; |
| 38 void CloseValidationMessage() override; | 39 void CloseValidationMessage() override; |
| 39 | 40 |
| 40 private: | 41 private: |
| 42 gfx::Rect RootViewToScreenRect( |
| 43 const gfx::Rect& rect_in_root_view, |
| 44 const content::RenderWidgetHostView* render_widget_host_view) const; |
| 45 |
| 41 gfx::Size size_; | 46 gfx::Size size_; |
| 42 | 47 |
| 43 DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleView); | 48 DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleView); |
| 44 }; | 49 }; |
| 45 | 50 |
| 46 #endif // CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_ | 51 #endif // CHROME_BROWSER_UI_VIEWS_VALIDATION_MESSAGE_BUBBLE_VIEW_H_ |
| OLD | NEW |