summaryrefslogtreecommitdiffstats
path: root/chrome/browser/cookie_modal_dialog.h
diff options
context:
space:
mode:
authorjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 21:38:56 +0000
committerjorlow@chromium.org <jorlow@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 21:38:56 +0000
commit8f53962c5743fe97d0c0dd547b5e056a7a68c196 (patch)
treec680ea6d31cb9c518ac9e911e699569abb18b9f4 /chrome/browser/cookie_modal_dialog.h
parent0586b0e71d0b79511d8acbab2e7dedd41c830867 (diff)
downloadchromium_src-8f53962c5743fe97d0c0dd547b5e056a7a68c196.zip
chromium_src-8f53962c5743fe97d0c0dd547b5e056a7a68c196.tar.gz
chromium_src-8f53962c5743fe97d0c0dd547b5e056a7a68c196.tar.bz2
Make the setItem CONTENT_SETTING_ASK dialog more useful by showing the actual key and value. Unfortunately, we're going to have to abuse cookie strings for 4.1 Once this goes in, I'll add new strings for the actual fields.
This also cleans up the code some. TEST=Instead of size/modified information you'll see "name" and "content" in the dialog that comes up when asking whether to allow local storage. BUG=none Review URL: http://codereview.chromium.org/597061 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38952 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/cookie_modal_dialog.h')
-rw-r--r--chrome/browser/cookie_modal_dialog.h36
1 files changed, 26 insertions, 10 deletions
diff --git a/chrome/browser/cookie_modal_dialog.h b/chrome/browser/cookie_modal_dialog.h
index d36bb93..f704bad 100644
--- a/chrome/browser/cookie_modal_dialog.h
+++ b/chrome/browser/cookie_modal_dialog.h
@@ -18,15 +18,24 @@ class PrefService;
// |NativeDialog| is a platform specific view.
class CookiePromptModalDialog : public AppModalDialog {
public:
+ enum DialogType {
+ DIALOG_TYPE_COOKIE = 0,
+ DIALOG_TYPE_LOCAL_STORAGE
+ // TODO(jorlow): Database
+ // TODO(michaeln): AppCache
+ };
+
// A union of data necessary to determine the type of message box to
// show.
CookiePromptModalDialog(TabContents* tab_contents,
- const std::string& host,
+ const GURL& origin,
const std::string& cookie_line,
CookiePromptModalDialogDelegate* delegate);
CookiePromptModalDialog(
TabContents* tab_contents,
- const BrowsingDataLocalStorageHelper::LocalStorageInfo& storage_info,
+ const GURL& origin,
+ const string16& key,
+ const string16& value,
CookiePromptModalDialogDelegate* delegate);
virtual ~CookiePromptModalDialog() {}
@@ -37,6 +46,13 @@ class CookiePromptModalDialog : public AppModalDialog {
virtual void AcceptWindow();
virtual void CancelWindow();
+ DialogType dialog_type() const { return dialog_type_; }
+ const GURL& origin() const { return origin_; }
+ const std::string& cookie_line() const { return cookie_line_; }
+ const string16& local_storage_key() const { return local_storage_key_; }
+ const string16& local_storage_value() const { return local_storage_value_; }
+ CookiePromptModalDialogDelegate* GetDelegate() { return delegate_; }
+
protected:
// AppModalDialog overrides.
virtual NativeDialog CreateNativeDialog();
@@ -45,17 +61,17 @@ class CookiePromptModalDialog : public AppModalDialog {
#endif
private:
- // Cookie host.
- std::string host_;
+ const DialogType dialog_type_;
- // Cookie to display.
- std::string cookie_line_;
+ // The origin connected to this request.
+ GURL origin_;
- // Local storage info to display.
- BrowsingDataLocalStorageHelper::LocalStorageInfo storage_info_;
+ // Cookie to display.
+ const std::string cookie_line_;
- // Whether we're showing cookie UI as opposed to other site data.
- bool cookie_ui_;
+ // LocalStorage key/value.
+ const string16 local_storage_key_;
+ const string16 local_storage_value_;
// Delegate. The caller should provide one in order to receive results
// from this delegate.