| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_ | 5 #ifndef CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_ |
| 6 #define CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_ | 6 #define CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "chrome/browser/app_modal_dialog.h" | 10 #include "chrome/browser/app_modal_dialog.h" |
| 11 #include "chrome/browser/browsing_data_local_storage_helper.h" | 11 #include "chrome/browser/browsing_data_local_storage_helper.h" |
| 12 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" | 12 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" |
| 13 #include "googleurl/src/gurl.h" | 13 #include "googleurl/src/gurl.h" |
| 14 | 14 |
| 15 class PrefService; | 15 class PrefService; |
| 16 | 16 |
| 17 // A controller+model class for cookie and local storage warning prompt. | 17 // A controller+model class for cookie and local storage warning prompt. |
| 18 // |NativeDialog| is a platform specific view. | 18 // |NativeDialog| is a platform specific view. |
| 19 class CookiePromptModalDialog : public AppModalDialog { | 19 class CookiePromptModalDialog : public AppModalDialog { |
| 20 public: | 20 public: |
| 21 // A union of data necessary to determine the type of message box to | 21 // A union of data necessary to determine the type of message box to |
| 22 // show. | 22 // show. |
| 23 CookiePromptModalDialog(TabContents* tab_contents, | 23 CookiePromptModalDialog(TabContents* tab_contents, |
| 24 const std::string& host, | 24 const GURL& url, |
| 25 const std::string& cookie_line, | 25 const std::string& cookie_line, |
| 26 CookiePromptModalDialogDelegate* delegate); | 26 CookiePromptModalDialogDelegate* delegate); |
| 27 CookiePromptModalDialog( | 27 CookiePromptModalDialog( |
| 28 TabContents* tab_contents, | 28 TabContents* tab_contents, |
| 29 const BrowsingDataLocalStorageHelper::LocalStorageInfo& storage_info, | 29 const BrowsingDataLocalStorageHelper::LocalStorageInfo& storage_info, |
| 30 CookiePromptModalDialogDelegate* delegate); | 30 CookiePromptModalDialogDelegate* delegate); |
| 31 virtual ~CookiePromptModalDialog() {} | 31 virtual ~CookiePromptModalDialog() {} |
| 32 | 32 |
| 33 static void RegisterPrefs(PrefService* prefs); | 33 static void RegisterPrefs(PrefService* prefs); |
| 34 | 34 |
| 35 // AppModalDialog overrides. | 35 // AppModalDialog overrides. |
| 36 virtual int GetDialogButtons(); | 36 virtual int GetDialogButtons(); |
| 37 virtual void AcceptWindow(); | 37 virtual void AcceptWindow(); |
| 38 virtual void CancelWindow(); | 38 virtual void CancelWindow(); |
| 39 | 39 |
| 40 protected: | 40 protected: |
| 41 // AppModalDialog overrides. | 41 // AppModalDialog overrides. |
| 42 virtual NativeDialog CreateNativeDialog(); | 42 virtual NativeDialog CreateNativeDialog(); |
| 43 #if defined(OS_LINUX) | 43 #if defined(OS_LINUX) |
| 44 virtual void HandleDialogResponse(GtkDialog* dialog, gint response_id); | 44 virtual void HandleDialogResponse(GtkDialog* dialog, gint response_id); |
| 45 #endif | 45 #endif |
| 46 | 46 |
| 47 private: | 47 private: |
| 48 // Cookie host. | 48 // Cookie URL. |
| 49 std::string host_; | 49 GURL url_; |
| 50 | 50 |
| 51 // Cookie to display. | 51 // Cookie to display. |
| 52 std::string cookie_line_; | 52 std::string cookie_line_; |
| 53 | 53 |
| 54 // Local storage info to display. | 54 // Local storage info to display. |
| 55 BrowsingDataLocalStorageHelper::LocalStorageInfo storage_info_; | 55 BrowsingDataLocalStorageHelper::LocalStorageInfo storage_info_; |
| 56 | 56 |
| 57 // Whether we're showing cookie UI as opposed to other site data. | 57 // Whether we're showing cookie UI as opposed to other site data. |
| 58 bool cookie_ui_; | 58 bool cookie_ui_; |
| 59 | 59 |
| 60 // Delegate. The caller should provide one in order to receive results | 60 // Delegate. The caller should provide one in order to receive results |
| 61 // from this delegate. | 61 // from this delegate. |
| 62 CookiePromptModalDialogDelegate* delegate_; | 62 CookiePromptModalDialogDelegate* delegate_; |
| 63 | 63 |
| 64 DISALLOW_COPY_AND_ASSIGN(CookiePromptModalDialog); | 64 DISALLOW_COPY_AND_ASSIGN(CookiePromptModalDialog); |
| 65 }; | 65 }; |
| 66 | 66 |
| 67 #endif // CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_ | 67 #endif // CHROME_BROWSER_COOKIE_MODAL_DIALOG_H_ |
| 68 | 68 |
| OLD | NEW |