| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 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 | 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_TAB_DIALOGS_H_ | 5 #ifndef CHROME_BROWSER_UI_TAB_DIALOGS_H_ |
| 6 #define CHROME_BROWSER_UI_TAB_DIALOGS_H_ | 6 #define CHROME_BROWSER_UI_TAB_DIALOGS_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| 11 #include "base/strings/string16.h" | 11 #include "base/strings/string16.h" |
| 12 #include "base/supports_user_data.h" | 12 #include "base/supports_user_data.h" |
| 13 #include "chrome/browser/ui/validation_message_bubble.h" | 13 #include "chrome/browser/ui/validation_message_bubble.h" |
| 14 #include "ui/gfx/native_widget_types.h" |
| 14 | 15 |
| 15 class Browser; | 16 class Browser; |
| 16 class Profile; | 17 class Profile; |
| 17 | 18 |
| 18 namespace content { | 19 namespace content { |
| 19 class WebContents; | 20 class WebContents; |
| 20 } | 21 } |
| 21 | 22 |
| 22 namespace gfx { | 23 namespace gfx { |
| 23 class Rect; | 24 class Rect; |
| 24 } | 25 } |
| 25 | 26 |
| 26 namespace ui { | 27 namespace ui { |
| 27 class ProfileSigninConfirmationDelegate; | 28 class ProfileSigninConfirmationDelegate; |
| 28 } | 29 } |
| 29 | 30 |
| 30 // A cross-platform interface for invoking various tab modal dialogs/bubbles. | 31 // A cross-platform interface for invoking various tab modal dialogs/bubbles. |
| 31 class TabDialogs : public base::SupportsUserData::Data { | 32 class TabDialogs : public base::SupportsUserData::Data { |
| 32 public: | 33 public: |
| 33 ~TabDialogs() override {} | 34 ~TabDialogs() override {} |
| 34 | 35 |
| 35 // Creates a platform specific instance, and attaches it to |contents|. | 36 // Creates a platform specific instance, and attaches it to |contents|. |
| 36 // If an instance is already attached, does nothing. | 37 // If an instance is already attached, does nothing. |
| 37 static void CreateForWebContents(content::WebContents* contents); | 38 static void CreateForWebContents(content::WebContents* contents); |
| 38 | 39 |
| 39 // Returns the instance that was attached to |contents|. | 40 // Returns the instance that was attached to |contents|. |
| 40 // If no instance was attached, returns NULL. | 41 // If no instance was attached, returns NULL. |
| 41 static TabDialogs* FromWebContents(content::WebContents* contents); | 42 static TabDialogs* FromWebContents(content::WebContents* contents); |
| 42 | 43 |
| 44 // Returns the parent view to use when showing a tab modal dialog. |
| 45 virtual gfx::NativeView GetDialogParentView() const = 0; |
| 46 |
| 43 // Shows the collected cookies dialog box. | 47 // Shows the collected cookies dialog box. |
| 44 virtual void ShowCollectedCookies() = 0; | 48 virtual void ShowCollectedCookies() = 0; |
| 45 | 49 |
| 46 // Shows or hides the hung renderer dialog. | 50 // Shows or hides the hung renderer dialog. |
| 47 virtual void ShowHungRendererDialog() = 0; | 51 virtual void ShowHungRendererDialog() = 0; |
| 48 virtual void HideHungRendererDialog() = 0; | 52 virtual void HideHungRendererDialog() = 0; |
| 49 | 53 |
| 50 // Shows a dialog asking the user to confirm linking to a managed account. | 54 // Shows a dialog asking the user to confirm linking to a managed account. |
| 51 virtual void ShowProfileSigninConfirmation( | 55 virtual void ShowProfileSigninConfirmation( |
| 52 Browser* browser, | 56 Browser* browser, |
| 53 Profile* profile, | 57 Profile* profile, |
| 54 const std::string& username, | 58 const std::string& username, |
| 55 ui::ProfileSigninConfirmationDelegate* delegate) = 0; | 59 ui::ProfileSigninConfirmationDelegate* delegate) = 0; |
| 56 | 60 |
| 57 // Shows or hides the ManagePasswords bubble. | 61 // Shows or hides the ManagePasswords bubble. |
| 58 // Pass true for |user_action| if this is a user initiated action. | 62 // Pass true for |user_action| if this is a user initiated action. |
| 59 virtual void ShowManagePasswordsBubble(bool user_action) = 0; | 63 virtual void ShowManagePasswordsBubble(bool user_action) = 0; |
| 60 virtual void HideManagePasswordsBubble() = 0; | 64 virtual void HideManagePasswordsBubble() = 0; |
| 61 | 65 |
| 62 virtual scoped_ptr<ValidationMessageBubble> ShowValidationMessage( | 66 virtual scoped_ptr<ValidationMessageBubble> ShowValidationMessage( |
| 63 const gfx::Rect& anchor_in_root_view, | 67 const gfx::Rect& anchor_in_root_view, |
| 64 const base::string16& main_text, | 68 const base::string16& main_text, |
| 65 const base::string16& sub_text) = 0; | 69 const base::string16& sub_text) = 0; |
| 66 | 70 |
| 67 protected: | 71 protected: |
| 68 static const void* UserDataKey(); | 72 static const void* UserDataKey(); |
| 69 }; | 73 }; |
| 70 | 74 |
| 71 #endif // CHROME_BROWSER_UI_TAB_DIALOGS_H_ | 75 #endif // CHROME_BROWSER_UI_TAB_DIALOGS_H_ |
| OLD | NEW |