summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cookie_modal_dialog.h
diff options
context:
space:
mode:
authorzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:32:14 +0000
committerzelidrag@chromium.org <zelidrag@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-05 22:32:14 +0000
commit12f74a94c21e19c74208dacf1dc5ef46f8a27f53 (patch)
treed10fe102066ab8b0a437b18ffc70aa228d02ba4e /chrome/browser/cookie_modal_dialog.h
parent225c8f507421a2eff2ed7a900104431d04ed7e5e (diff)
downloadchromium_src-12f74a94c21e19c74208dacf1dc5ef46f8a27f53.zip
chromium_src-12f74a94c21e19c74208dacf1dc5ef46f8a27f53.tar.gz
chromium_src-12f74a94c21e19c74208dacf1dc5ef46f8a27f53.tar.bz2
Refactored out JS specific part of modal dialog stack into its own class, exposed cookie/storage prompt as a modal dialog.
BUG=32719 TEST=none, requires Darin to hook this with his code. Review URL: http://codereview.chromium.org/560030 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38268 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookie_modal_dialog.h')
-rw-r--r--chrome/browser/cookie_modal_dialog.h65
1 files changed, 65 insertions, 0 deletions
diff --git a/chrome/browser/cookie_modal_dialog.h b/chrome/browser/cookie_modal_dialog.h
new file mode 100644
index 0000000..390e6137
--- /dev/null
+++ b/chrome/browser/cookie_modal_dialog.h
@@ -0,0 +1,65 @@
+// Copyright (c) 2010 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_COOKIE_MODAL_DIALOG_H_
+#define CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_
+
+#include <string>
+
+#include "chrome/browser/app_modal_dialog.h"
+#include "chrome/browser/browsing_data_local_storage_helper.h"
+#include "chrome/browser/cookie_prompt_modal_dialog_delegate.h"
+#include "googleurl/src/gurl.h"
+
+
+// A controller+model class for cookie and local storage warning prompt.
+// |NativeDialog| is a platform specific view.
+class CookiePromptModalDialog : public AppModalDialog {
+ public:
+ // A union of data necessary to determine the type of message box to
+ // show.
+ CookiePromptModalDialog(TabContents* tab_contents,
+ const GURL& url,
+ const std::string& cookie_line,
+ CookiePromptModalDialogDelegate* delegate);
+ CookiePromptModalDialog(
+ TabContents* tab_contents,
+ const BrowsingDataLocalStorageHelper::LocalStorageInfo& storage_info,
+ CookiePromptModalDialogDelegate* delegate);
+ virtual ~CookiePromptModalDialog() {}
+
+ // AppModalDialog overrides.
+ virtual int GetDialogButtons();
+ virtual void AcceptWindow();
+ virtual void CancelWindow();
+
+ protected:
+ // AppModalDialog overrides.
+ virtual NativeDialog CreateNativeDialog();
+#if defined(OS_LINUX)
+ virtual void HandleDialogResponse(GtkDialog* dialog, gint response_id);
+#endif
+
+ private:
+ // Cookie url.
+ GURL url_;
+
+ // Cookie to display.
+ std::string cookie_line_;
+
+ // Local storage info to display.
+ BrowsingDataLocalStorageHelper::LocalStorageInfo storage_info_;
+
+ // Whether we're showing cookie UI as opposed to other site data.
+ bool cookie_ui_;
+
+ // Delegate. The caller should provide one in order to receive results
+ // from this delegate.
+ CookiePromptModalDialogDelegate* delegate_;
+
+ DISALLOW_COPY_AND_ASSIGN(CookiePromptModalDialog);
+};
+
+#endif // CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_
+