| 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_VIEWS_COOKIE_PROMPT_VIEW_H_ | 5 #ifndef CHROME_BROWSER_VIEWS_COOKIE_PROMPT_VIEW_H_ |
| 6 #define CHROME_BROWSER_VIEWS_COOKIE_PROMPT_VIEW_H_ | 6 #define CHROME_BROWSER_VIEWS_COOKIE_PROMPT_VIEW_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/task.h" | 10 #include "base/task.h" |
| (...skipping 25 matching lines...) Expand all Loading... |
| 36 public views::ButtonListener, | 36 public views::ButtonListener, |
| 37 public views::LinkController, | 37 public views::LinkController, |
| 38 public CookieInfoViewDelegate { | 38 public CookieInfoViewDelegate { |
| 39 public: | 39 public: |
| 40 CookiePromptView( | 40 CookiePromptView( |
| 41 CookiePromptModalDialog* parent, | 41 CookiePromptModalDialog* parent, |
| 42 gfx::NativeWindow root_window, | 42 gfx::NativeWindow root_window, |
| 43 Profile* profile, | 43 Profile* profile, |
| 44 const BrowsingDataLocalStorageHelper::LocalStorageInfo& | 44 const BrowsingDataLocalStorageHelper::LocalStorageInfo& |
| 45 local_storage_info, | 45 local_storage_info, |
| 46 const std::string& host, | 46 const GURL& url, |
| 47 const std::string& cookie_line, | 47 const std::string& cookie_line, |
| 48 CookiePromptModalDialogDelegate* delegate, | 48 CookiePromptModalDialogDelegate* delegate, |
| 49 bool cookie_ui); | 49 bool cookie_ui); |
| 50 | 50 |
| 51 virtual ~CookiePromptView(); | 51 virtual ~CookiePromptView(); |
| 52 | 52 |
| 53 protected: | 53 protected: |
| 54 // views::View overrides. | 54 // views::View overrides. |
| 55 virtual gfx::Size GetPreferredSize(); | 55 virtual gfx::Size GetPreferredSize(); |
| 56 virtual void ViewHierarchyChanged(bool is_add, | 56 virtual void ViewHierarchyChanged(bool is_add, |
| (...skipping 28 matching lines...) Expand all Loading... |
| 85 // Initialize the dialog layout. | 85 // Initialize the dialog layout. |
| 86 void Init(); | 86 void Init(); |
| 87 | 87 |
| 88 // Shows or hides cooke info view and changes parent. | 88 // Shows or hides cooke info view and changes parent. |
| 89 void ToggleDetailsViewExpand(); | 89 void ToggleDetailsViewExpand(); |
| 90 | 90 |
| 91 // Calculates view size offset depending on visibility of cookie details. | 91 // Calculates view size offset depending on visibility of cookie details. |
| 92 int GetExtendedViewHeight(); | 92 int GetExtendedViewHeight(); |
| 93 | 93 |
| 94 // Initializes text resources needed to display this view. | 94 // Initializes text resources needed to display this view. |
| 95 void InitializeViewResources(const std::string& domain); | 95 void InitializeViewResources(); |
| 96 | 96 |
| 97 views::RadioButton* remember_radio_; | 97 views::RadioButton* remember_radio_; |
| 98 views::RadioButton* ask_radio_; | 98 views::RadioButton* ask_radio_; |
| 99 views::NativeButton* allow_button_; | 99 views::NativeButton* allow_button_; |
| 100 views::NativeButton* block_button_; | 100 views::NativeButton* block_button_; |
| 101 views::Link* show_cookie_link_; | 101 views::Link* show_cookie_link_; |
| 102 views::View* info_view_; | 102 views::View* info_view_; |
| 103 | 103 |
| 104 // True if cookie should expire with this session. | 104 // True if cookie should expire with this session. |
| 105 bool session_expire_; | 105 bool session_expire_; |
| 106 | 106 |
| 107 // True if cookie info view is currently shown and window expanded. | 107 // True if cookie info view is currently shown and window expanded. |
| 108 bool expanded_view_; | 108 bool expanded_view_; |
| 109 | 109 |
| 110 // True if the outcome of this dialog has been signaled to the delegate. | 110 // True if the outcome of this dialog has been signaled to the delegate. |
| 111 bool signaled_; | 111 bool signaled_; |
| 112 | 112 |
| 113 // Prompt window title. | 113 // Prompt window title. |
| 114 std::wstring title_; | 114 std::wstring title_; |
| 115 | 115 |
| 116 // Whether we're showing cookie UI as opposed to other site data. | 116 // Whether we're showing cookie UI as opposed to other site data. |
| 117 bool cookie_ui_; | 117 bool cookie_ui_; |
| 118 | 118 |
| 119 // A pointer to the AppModalDialog that owns us. | 119 // A pointer to the AppModalDialog that owns us. |
| 120 CookiePromptModalDialog* parent_; | 120 CookiePromptModalDialog* parent_; |
| 121 | 121 |
| 122 gfx::NativeWindow root_window_; | 122 gfx::NativeWindow root_window_; |
| 123 | 123 |
| 124 GURL url_; |
| 125 |
| 124 // Cookie / local storage host. | 126 // Cookie / local storage host. |
| 125 std::string host_; | 127 std::string host_; |
| 126 | 128 |
| 127 // Displayed cookie. Only used when |cookie_ui_| is true. | 129 // Displayed cookie. Only used when |cookie_ui_| is true. |
| 128 std::string cookie_line_; | 130 std::string cookie_line_; |
| 129 | 131 |
| 130 // Displayed local storage info. Only used when |cookie_ui_| is false. | 132 // Displayed local storage info. Only used when |cookie_ui_| is false. |
| 131 BrowsingDataLocalStorageHelper::LocalStorageInfo local_storage_info_; | 133 BrowsingDataLocalStorageHelper::LocalStorageInfo local_storage_info_; |
| 132 | 134 |
| 133 CookiePromptModalDialogDelegate* delegate_; | 135 CookiePromptModalDialogDelegate* delegate_; |
| 134 | 136 |
| 135 DISALLOW_COPY_AND_ASSIGN(CookiePromptView); | 137 DISALLOW_COPY_AND_ASSIGN(CookiePromptView); |
| 136 }; | 138 }; |
| 137 | 139 |
| 138 #endif // CHROME_BROWSER_VIEWS_COOKIE_PROMPT_VIEW_H_ | 140 #endif // CHROME_BROWSER_VIEWS_COOKIE_PROMPT_VIEW_H_ |
| 139 | 141 |
| OLD | NEW |