1 // Copyright (c) 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_VALIDATION_MESSAGE_BUBBLE_H_
6 #define CHROME_BROWSER_UI_VALIDATION_MESSAGE_BUBBLE_H_
8 #include "base/memory/scoped_ptr.h"
9 #include "base/strings/string16.h"
12 class RenderWidgetHost
;
21 class ValidationMessageBubble
{
23 // Open a tooltip-like window to show the specified messages. The window
24 // should not change focus state.
25 static scoped_ptr
<ValidationMessageBubble
> CreateAndShow(
26 content::RenderWidgetHost
* widget_host
,
27 const gfx::Rect
& anchor_in_root_view
,
28 const string16
& main_text
,
29 const string16
& sub_text
);
31 // Close the window and destruct the object.
32 virtual ~ValidationMessageBubble() {}
34 // Move the window to a position such that the bubble arrow points to the
35 // specified anchor. |anchor_in_root_view| is in DIP unit, and relative to
36 // RWHV for |widget_host|.
37 virtual void SetPositionRelativeToAnchor(
38 content::RenderWidgetHost
* widget_host
,
39 const gfx::Rect
& anchor_in_root_view
) = 0;
44 #endif // CHROME_BROWSER_UI_VALIDATION_MESSAGE_BUBBLE_H_