OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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_UI_VIEWS_COOKIE_INFO_VIEW_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_ |
7 | 7 |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
13 #include "base/string16.h" | 13 #include "base/string16.h" |
14 #include "net/cookies/cookie_monster.h" | |
15 #include "ui/base/models/combobox_model.h" | 14 #include "ui/base/models/combobox_model.h" |
16 #include "ui/views/controls/combobox/combobox_listener.h" | 15 #include "ui/views/controls/combobox/combobox_listener.h" |
17 #include "ui/views/view.h" | 16 #include "ui/views/view.h" |
18 | 17 |
19 namespace views { | 18 namespace views { |
20 class GridLayout; | 19 class GridLayout; |
21 class Label; | 20 class Label; |
22 class Textfield; | 21 class Textfield; |
23 } | 22 } |
24 | 23 |
| 24 namespace net { |
| 25 class CanonicalCookie; |
| 26 } |
25 | 27 |
26 /////////////////////////////////////////////////////////////////////////////// | 28 /////////////////////////////////////////////////////////////////////////////// |
27 // CookieInfoViewDelegate | 29 // CookieInfoViewDelegate |
28 // | 30 // |
29 class CookieInfoViewDelegate { | 31 class CookieInfoViewDelegate { |
30 public: | 32 public: |
31 virtual void ModifyExpireDate(bool session_expire) = 0; | 33 virtual void ModifyExpireDate(bool session_expire) = 0; |
32 | 34 |
33 protected: | 35 protected: |
34 virtual ~CookieInfoViewDelegate() {} | 36 virtual ~CookieInfoViewDelegate() {} |
35 }; | 37 }; |
36 | 38 |
37 /////////////////////////////////////////////////////////////////////////////// | 39 /////////////////////////////////////////////////////////////////////////////// |
38 // CookieInfoView | 40 // CookieInfoView |
39 // | 41 // |
40 // Responsible for displaying a tabular grid of Cookie information. | 42 // Responsible for displaying a tabular grid of Cookie information. |
41 class CookieInfoView : public views::View, | 43 class CookieInfoView : public views::View, |
42 public views::ComboboxListener, | 44 public views::ComboboxListener, |
43 public ui::ComboboxModel { | 45 public ui::ComboboxModel { |
44 public: | 46 public: |
45 explicit CookieInfoView(bool editable_expiration_date); | 47 explicit CookieInfoView(bool editable_expiration_date); |
46 virtual ~CookieInfoView(); | 48 virtual ~CookieInfoView(); |
47 | 49 |
48 // Update the display from the specified CookieNode. | 50 // Update the display from the specified CookieNode. |
49 void SetCookie(const std::string& domain, | 51 void SetCookie(const std::string& domain, |
50 const net::CookieMonster::CanonicalCookie& cookie_node); | 52 const net::CanonicalCookie& cookie_node); |
51 | 53 |
52 // Update the display from the specified cookie string. | 54 // Update the display from the specified cookie string. |
53 void SetCookieString(const GURL& url, const std::string& cookie_line); | 55 void SetCookieString(const GURL& url, const std::string& cookie_line); |
54 | 56 |
55 // Clears the cookie display to indicate that no or multiple cookies are | 57 // Clears the cookie display to indicate that no or multiple cookies are |
56 // selected. | 58 // selected. |
57 void ClearCookieDisplay(); | 59 void ClearCookieDisplay(); |
58 | 60 |
59 // Enables or disables the cookie property text fields. | 61 // Enables or disables the cookie property text fields. |
60 void EnableCookieDisplay(bool enabled); | 62 void EnableCookieDisplay(bool enabled); |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
111 // CookiesPromptView (alert before cookie is set), in all other cases we | 113 // CookiesPromptView (alert before cookie is set), in all other cases we |
112 // don't let user directly change cookie setting. | 114 // don't let user directly change cookie setting. |
113 bool editable_expiration_date_; | 115 bool editable_expiration_date_; |
114 | 116 |
115 CookieInfoViewDelegate* delegate_; | 117 CookieInfoViewDelegate* delegate_; |
116 | 118 |
117 DISALLOW_COPY_AND_ASSIGN(CookieInfoView); | 119 DISALLOW_COPY_AND_ASSIGN(CookieInfoView); |
118 }; | 120 }; |
119 | 121 |
120 #endif // CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_ | 122 #endif // CHROME_BROWSER_UI_VIEWS_COOKIE_INFO_VIEW_H_ |
OLD | NEW |