Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2905)

Unified Diff: chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h

Issue 9225053: Add a blocking version of the sync promo dialog (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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..962dd8dd805240bbfc834924bc71dbfffada4cd1
--- /dev/null
+++ b/chrome/browser/ui/webui/sync_promo/sync_promo_dialog.h
@@ -0,0 +1,60 @@
+// 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_; }
+
+ // Returns true if the sync promo was closed.
+ bool sync_promo_was_closed() { 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 HandlerAddNewContents(content::WebContents* source,
+ content::WebContents* new_contents,
+ WindowOpenDisposition disposition,
+ const gfx::Rect& initial_pos,
+ bool user_gesture) OVERRIDE;
+
+ Profile* profile_;
+ Browser* spawned_browser_;
+ bool sync_promo_was_closed_;
+ GURL url_;
+ gfx::NativeWindow window_;
+};
sky 2012/01/30 15:27:47 DISALLOW_COPY_AND_ASSIGN
sail 2012/01/30 17:13:03 Done.
+
+#endif // CHROME_BROWSER_UI_WEBUI_SYNC_PROMO_SYNC_PROMO_DIALOG_H_

Powered by Google App Engine
This is Rietveld 408576698