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

Side by Side Diff: chrome/browser/ui/cocoa/validation_message_bubble_cocoa.h

Issue 1880853002: Convert ValidationMessageBubbleView to BubbleDialogDelegate (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: docs 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 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_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> {
groby-ooo-7-16 2016/04/13 01:42:31 You're aware of the lifetime issues (WeakPtr is on
Evan Stade 2016/04/13 15:39:19 supports is fine for our purposes, I think.
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698