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 #include "chrome/browser/ui/views/cookie_info_view.h" | 5 #include "chrome/browser/ui/views/cookie_info_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/i18n/time_formatting.h" | 9 #include "base/i18n/time_formatting.h" |
10 #include "base/message_loop/message_loop.h" | 10 #include "base/message_loop/message_loop.h" |
(...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 domain_value_field_->SetText(base::UTF8ToUTF16(domain)); | 56 domain_value_field_->SetText(base::UTF8ToUTF16(domain)); |
57 path_value_field_->SetText(base::UTF8ToUTF16(cookie.Path())); | 57 path_value_field_->SetText(base::UTF8ToUTF16(cookie.Path())); |
58 created_value_field_->SetText( | 58 created_value_field_->SetText( |
59 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate())); | 59 base::TimeFormatFriendlyDateAndTime(cookie.CreationDate())); |
60 | 60 |
61 base::string16 expire_text = cookie.IsPersistent() ? | 61 base::string16 expire_text = cookie.IsPersistent() ? |
62 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate()) : | 62 base::TimeFormatFriendlyDateAndTime(cookie.ExpiryDate()) : |
63 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_SESSION); | 63 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_EXPIRES_SESSION); |
64 | 64 |
65 expires_value_field_->SetText(expire_text); | 65 expires_value_field_->SetText(expire_text); |
66 send_for_value_field_->SetText(cookie.IsSecure() ? | 66 send_for_value_field_->SetText( |
67 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : | 67 l10n_util::GetStringUTF16(CookiesTreeModel::GetSendForMessageID(cookie))); |
68 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_ANY)); | |
69 EnableCookieDisplay(true); | 68 EnableCookieDisplay(true); |
70 Layout(); | 69 Layout(); |
71 } | 70 } |
72 | 71 |
73 void CookieInfoView::SetCookieString(const GURL& url, | 72 void CookieInfoView::SetCookieString(const GURL& url, |
74 const std::string& cookie_line) { | 73 const std::string& cookie_line) { |
75 net::ParsedCookie pc(cookie_line); | 74 net::ParsedCookie pc(cookie_line); |
76 net::CanonicalCookie cookie(url, pc); | 75 net::CanonicalCookie cookie(url, pc); |
77 SetCookie(pc.HasDomain() ? pc.Domain() : url.host(), cookie); | 76 SetCookie(pc.HasDomain() ? pc.Domain() : url.host(), cookie); |
78 } | 77 } |
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 AddLabelRow(three_column_layout_id, layout, domain_label_, | 176 AddLabelRow(three_column_layout_id, layout, domain_label_, |
178 domain_value_field_); | 177 domain_value_field_); |
179 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); | 178 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); |
180 AddLabelRow(three_column_layout_id, layout, send_for_label_, | 179 AddLabelRow(three_column_layout_id, layout, send_for_label_, |
181 send_for_value_field_); | 180 send_for_value_field_); |
182 AddLabelRow(three_column_layout_id, layout, created_label_, | 181 AddLabelRow(three_column_layout_id, layout, created_label_, |
183 created_value_field_); | 182 created_value_field_); |
184 AddLabelRow(three_column_layout_id, layout, expires_label_, | 183 AddLabelRow(three_column_layout_id, layout, expires_label_, |
185 expires_value_field_); | 184 expires_value_field_); |
186 } | 185 } |
OLD | NEW |