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_COCOA_VALIDATION_MESSAGE_BUBBLE_COCOA_H_ | 5 #ifndef CHROME_BROWSER_UI_COCOA_VALIDATION_MESSAGE_BUBBLE_COCOA_H_ |
6 #define CHROME_BROWSER_UI_COCOA_VALIDATION_MESSAGE_BUBBLE_COCOA_H_ | 6 #define CHROME_BROWSER_UI_COCOA_VALIDATION_MESSAGE_BUBBLE_COCOA_H_ |
7 | 7 |
8 #include "base/mac/scoped_nsobject.h" | 8 #include "base/mac/scoped_nsobject.h" |
9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/weak_ptr.h" |
10 #include "chrome/browser/ui/validation_message_bubble.h" | 11 #include "chrome/browser/ui/validation_message_bubble.h" |
11 | 12 |
12 @class ValidationMessageBubbleController; | 13 @class ValidationMessageBubbleController; |
13 | 14 |
14 namespace content { | 15 namespace content { |
15 class WebContents; | 16 class WebContents; |
16 } | 17 } |
17 | 18 |
18 class ValidationMessageBubbleCocoa : public ValidationMessageBubble { | 19 class ValidationMessageBubbleCocoa |
| 20 : public ValidationMessageBubble, |
| 21 public base::SupportsWeakPtr<ValidationMessageBubbleCocoa> { |
19 public: | 22 public: |
20 ValidationMessageBubbleCocoa(content::WebContents* web_contents, | 23 ValidationMessageBubbleCocoa(content::WebContents* web_contents, |
21 const gfx::Rect& anchor_in_root_view, | 24 const gfx::Rect& anchor_in_root_view, |
22 const base::string16& main_text, | 25 const base::string16& main_text, |
23 const base::string16& sub_text); | 26 const base::string16& sub_text); |
24 ~ValidationMessageBubbleCocoa() override; | 27 ~ValidationMessageBubbleCocoa() override; |
25 | 28 |
26 // ValidationMessageBubble overrides: | 29 // ValidationMessageBubble overrides: |
27 void SetPositionRelativeToAnchor( | 30 void SetPositionRelativeToAnchor( |
28 content::RenderWidgetHost* widget_host, | 31 content::RenderWidgetHost* widget_host, |
29 const gfx::Rect& anchor_in_root_view) override; | 32 const gfx::Rect& anchor_in_root_view) override; |
| 33 void CloseValidationMessage() override; |
30 | 34 |
31 private: | 35 private: |
32 base::scoped_nsobject<ValidationMessageBubbleController> controller_; | 36 base::scoped_nsobject<ValidationMessageBubbleController> controller_; |
33 | 37 |
34 DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleCocoa); | 38 DISALLOW_COPY_AND_ASSIGN(ValidationMessageBubbleCocoa); |
35 }; | 39 }; |
36 | 40 |
37 #endif // CHROME_BROWSER_UI_COCOA_VALIDATION_MESSAGE_BUBBLE_COCOA_H_ | 41 #endif // CHROME_BROWSER_UI_COCOA_VALIDATION_MESSAGE_BUBBLE_COCOA_H_ |
OLD | NEW |