Index: chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h |
diff --git a/chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h b/chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h |
new file mode 100644 |
index 0000000000000000000000000000000000000000..abaff603dca64e59f49859092b9834988a7b5d4d |
--- /dev/null |
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h |
@@ -0,0 +1,62 @@ |
+// Copyright (c) 2012 The Chromium Authors. All rights reserved. |
+// Use of this source code is governed by a BSD-style license that can be |
+// found in the LICENSE file. |
+ |
+#ifndef CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_DIALOG_H_ |
+#define CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_DIALOG_H_ |
+#pragma once |
+ |
+#include "chrome/browser/ui/webui/html_dialog_ui.h" |
+ |
+class Profile; |
+class Browser; |
+ |
+// Shows the sync promo in a HTML dialog. |
James Hawkins
2012/01/31 00:23:22
Optional nit: s/a/an/
sail
2012/01/31 01:03:46
Done.
|
+class SyncPromoDialog : public HtmlDialogUIDelegate { |
+ public: |
+ SyncPromoDialog(Profile* profile, GURL url); |
James Hawkins
2012/01/31 00:23:22
Document params.
sail
2012/01/31 01:03:46
Done.
|
+ virtual ~SyncPromoDialog(); |
+ |
+ // Shows the dialog and blocks until the dialog is dismissed. |
+ void ShowDialog(); |
+ |
+ // Returns the browser spawned from the sync promo dialog (if any). |
+ Browser* spawned_browser() const { return spawned_browser_; } |
+ |
+ // Returns true if the sync promo was closed. |
+ bool sync_promo_was_closed() const { return sync_promo_was_closed_; } |
+ |
+ private: |
+ // HtmlDialogUIDelegate: |
+ virtual ui::ModalType GetDialogModalType() const OVERRIDE; |
+ virtual string16 GetDialogTitle() const OVERRIDE; |
+ virtual GURL GetDialogContentURL() const OVERRIDE; |
+ virtual void GetWebUIMessageHandlers( |
+ std::vector<content::WebUIMessageHandler*>* handlers) const OVERRIDE; |
+ virtual void GetDialogSize(gfx::Size* size) const OVERRIDE; |
+ virtual std::string GetDialogArgs() const OVERRIDE; |
+ virtual void OnDialogClosed(const std::string& json_retval) OVERRIDE; |
+ virtual void OnCloseContents(content::WebContents* source, |
+ bool* out_close_dialog) OVERRIDE; |
+ virtual bool ShouldShowDialogTitle() const OVERRIDE; |
+ virtual bool HandleContextMenu(const ContextMenuParams& params) OVERRIDE; |
+ virtual bool HandleOpenURLFromTab( |
+ content::WebContents* source, |
+ const content::OpenURLParams& params, |
+ content::WebContents** out_new_contents) OVERRIDE; |
+ virtual bool HandleAddNewContents(content::WebContents* source, |
+ content::WebContents* new_contents, |
+ WindowOpenDisposition disposition, |
+ const gfx::Rect& initial_pos, |
+ bool user_gesture) OVERRIDE; |
+ |
+ Profile* profile_; |
James Hawkins
2012/01/31 00:23:22
Document member variables.
sail
2012/01/31 01:03:46
Done.
|
+ Browser* spawned_browser_; |
+ bool sync_promo_was_closed_; |
+ GURL url_; |
+ gfx::NativeWindow window_; |
+ |
+ DISALLOW_COPY_AND_ASSIGN(SyncPromoDialog); |
+}; |
+ |
+#endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_DIALOG_H_ |