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..bb22ba38cfddd10033c60e0a12b960c1f24a44b5 |
--- /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. |
+class SyncPromoDialog : public HtmlDialogUIDelegate { |
+ public: |
+ SyncPromoDialog(Profile* profile, GURL url); |
+ 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() { return spawned_browser_; } |
Dan Beam
2012/01/30 18:10:05
() const {, possibly ^const or ^const Browser&? (I
sail
2012/01/30 21:52:36
Done.
|
+ |
+ // Returns true if the sync promo was closed. |
+ bool sync_promo_was_closed() { return sync_promo_was_closed_; } |
Dan Beam
2012/01/30 18:10:05
const {, ^const?
sail
2012/01/30 21:52:36
Done.
|
+ |
+ private: |
+ // HtmlDialogUIDelegate: |
Dan Beam
2012/01/30 18:10:05
are these all just implementing HtmlDialogUIDelega
sail
2012/01/30 21:52:36
they're just implementing
|
+ 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_; |
Dan Beam
2012/01/30 18:10:05
if you feel it's useful, add more comments to inte
sail
2012/01/30 21:52:36
i think they're pretty straight forward, the more
|
+ 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_ |