Chromium Code Reviews| 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(l10n_util::GetStringUTF16( |
| 67 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_SECURE) : | 67 cookie.IsSecure() |
| 68 l10n_util::GetStringUTF16(IDS_COOKIES_COOKIE_SENDFOR_ANY)); | 68 ? cookie.IsFirstPartyOnly() |
| 69 ? IDS_COOKIES_COOKIE_SENDFOR_SECURE_FIRSTPARTY | |
| 70 : IDS_COOKIES_COOKIE_SENDFOR_SECURE | |
| 71 : cookie.IsFirstPartyOnly() ? IDS_COOKIES_COOKIE_SENDFOR_FIRSTPARTY | |
| 72 : IDS_COOKIES_COOKIE_SENDFOR_ANY)); | |
|
Pam (message me for reviews)
2015/03/20 10:30:38
Oh dear. There aren't any really great solutions h
| |
| 69 EnableCookieDisplay(true); | 73 EnableCookieDisplay(true); |
| 70 Layout(); | 74 Layout(); |
| 71 } | 75 } |
| 72 | 76 |
| 73 void CookieInfoView::SetCookieString(const GURL& url, | 77 void CookieInfoView::SetCookieString(const GURL& url, |
| 74 const std::string& cookie_line) { | 78 const std::string& cookie_line) { |
| 75 net::ParsedCookie pc(cookie_line); | 79 net::ParsedCookie pc(cookie_line); |
| 76 net::CanonicalCookie cookie(url, pc); | 80 net::CanonicalCookie cookie(url, pc); |
| 77 SetCookie(pc.HasDomain() ? pc.Domain() : url.host(), cookie); | 81 SetCookie(pc.HasDomain() ? pc.Domain() : url.host(), cookie); |
| 78 } | 82 } |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 177 AddLabelRow(three_column_layout_id, layout, domain_label_, | 181 AddLabelRow(three_column_layout_id, layout, domain_label_, |
| 178 domain_value_field_); | 182 domain_value_field_); |
| 179 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); | 183 AddLabelRow(three_column_layout_id, layout, path_label_, path_value_field_); |
| 180 AddLabelRow(three_column_layout_id, layout, send_for_label_, | 184 AddLabelRow(three_column_layout_id, layout, send_for_label_, |
| 181 send_for_value_field_); | 185 send_for_value_field_); |
| 182 AddLabelRow(three_column_layout_id, layout, created_label_, | 186 AddLabelRow(three_column_layout_id, layout, created_label_, |
| 183 created_value_field_); | 187 created_value_field_); |
| 184 AddLabelRow(three_column_layout_id, layout, expires_label_, | 188 AddLabelRow(three_column_layout_id, layout, expires_label_, |
| 185 expires_value_field_); | 189 expires_value_field_); |
| 186 } | 190 } |
| OLD | NEW |