1 // Copyright 2014 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_TAB_DIALOGS_H_
6 #define CHROME_BROWSER_UI_TAB_DIALOGS_H_
10 #include "base/memory/scoped_ptr.h"
11 #include "base/strings/string16.h"
12 #include "base/supports_user_data.h"
13 #include "chrome/browser/ui/validation_message_bubble.h"
27 class ProfileSigninConfirmationDelegate
;
30 // A cross-platform interface for invoking various tab modal dialogs/bubbles.
31 class TabDialogs
: public base::SupportsUserData::Data
{
33 ~TabDialogs() override
{}
35 // Creates a platform specific instance, and attaches it to |contents|.
36 // If an instance is already attached, does nothing.
37 static void CreateForWebContents(content::WebContents
* contents
);
39 // Returns the instance that was attached to |contents|.
40 // If no instance was attached, returns NULL.
41 static TabDialogs
* FromWebContents(content::WebContents
* contents
);
43 // Shows the collected cookies dialog box.
44 virtual void ShowCollectedCookies() = 0;
46 // Shows or hides the hung renderer dialog.
47 virtual void ShowHungRendererDialog() = 0;
48 virtual void HideHungRendererDialog() = 0;
50 // Shows a dialog asking the user to confirm linking to a managed account.
51 virtual void ShowProfileSigninConfirmation(
54 const std::string
& username
,
55 ui::ProfileSigninConfirmationDelegate
* delegate
) = 0;
57 // Shows or hides the ManagePasswords bubble.
58 // Pass true for |user_action| if this is a user initiated action.
59 virtual void ShowManagePasswordsBubble(bool user_action
) = 0;
60 virtual void HideManagePasswordsBubble() = 0;
62 virtual scoped_ptr
<ValidationMessageBubble
> ShowValidationMessage(
63 const gfx::Rect
& anchor_in_root_view
,
64 const base::string16
& main_text
,
65 const base::string16
& sub_text
) = 0;
68 static const void* UserDataKey();
71 #endif // CHROME_BROWSER_UI_TAB_DIALOGS_H_