summaryrefslogtreecommitdiffstats
path: root/chrome
diff options
context:
space:
mode:
Diffstat (limited to 'chrome')
-rw-r--r--chrome/browser/views/cookie_info_view.cc20
-rw-r--r--chrome/browser/views/cookie_info_view.h3
-rw-r--r--chrome/browser/views/cookie_prompt_view.cc10
-rw-r--r--chrome/browser/views/cookie_prompt_view.h2
4 files changed, 10 insertions, 25 deletions
diff --git a/chrome/browser/views/cookie_info_view.cc b/chrome/browser/views/cookie_info_view.cc
index 2f7970b..8929335 100644
--- a/chrome/browser/views/cookie_info_view.cc
+++ b/chrome/browser/views/cookie_info_view.cc
@@ -88,23 +88,11 @@ void CookieInfoView::SetCookie(
Layout();
}
-void CookieInfoView::SetCookieString(
- const std::string& host,
- const std::string& cookie_line) {
+void CookieInfoView::SetCookieString(const GURL& url,
+ const std::string& cookie_line) {
net::CookieMonster::ParsedCookie pc(cookie_line);
- net::CookieMonster::CanonicalCookie cookie(
- pc.Name(),
- pc.Value(),
- pc.Path(),
- pc.IsSecure(),
- pc.IsHttpOnly(),
- base::Time::Now(), // creation time
- base::Time(), // last access time is unused
- pc.HasExpires(),
- pc.HasExpires() ?
- net::CookieMonster::ParseCookieTime(pc.Expires()) :
- base::Time());
- SetCookie(pc.HasDomain() ? pc.Domain() : host, cookie);
+ net::CookieMonster::CanonicalCookie cookie(url, pc);
+ SetCookie(pc.HasDomain() ? pc.Domain() : url.host(), cookie);
}
diff --git a/chrome/browser/views/cookie_info_view.h b/chrome/browser/views/cookie_info_view.h
index f793d95..8db996e 100644
--- a/chrome/browser/views/cookie_info_view.h
+++ b/chrome/browser/views/cookie_info_view.h
@@ -48,8 +48,7 @@ class CookieInfoView : public views::View,
const net::CookieMonster::CanonicalCookie& cookie_node);
// Update the display from the specified cookie string.
- void SetCookieString(const std::string& host,
- const std::string& cookie_line);
+ void SetCookieString(const GURL& url, const std::string& cookie_line);
// Clears the cookie display to indicate that no or multiple cookies are
// selected.
diff --git a/chrome/browser/views/cookie_prompt_view.cc b/chrome/browser/views/cookie_prompt_view.cc
index dd2425e..0851114 100644
--- a/chrome/browser/views/cookie_prompt_view.cc
+++ b/chrome/browser/views/cookie_prompt_view.cc
@@ -52,7 +52,7 @@ CookiePromptView::CookiePromptView(
signaled_(false),
parent_(parent),
root_window_(root_window) {
- InitializeViewResources(parent_->origin().host());
+ InitializeViewResources();
expanded_view_ = g_browser_process->local_state()->
GetBoolean(prefs::kCookiePromptExpanded);
}
@@ -235,7 +235,7 @@ void CookiePromptView::Init() {
layout->AddView(cookie_info_view, 1, 1, GridLayout::FILL,
GridLayout::CENTER);
- cookie_info_view->SetCookieString(parent_->origin().host(), parent_->cookie_line());
+ cookie_info_view->SetCookieString(parent_->origin(), parent_->cookie_line());
info_view_ = cookie_info_view;
} else if (type == CookiePromptModalDialog::DIALOG_TYPE_LOCAL_STORAGE) {
LocalStorageSetItemInfoView* view = new LocalStorageSetItemInfoView();
@@ -278,10 +278,8 @@ void CookiePromptView::ToggleDetailsViewExpand() {
window->SetBounds(bounds, NULL);
}
-void CookiePromptView::InitializeViewResources(const std::string& host) {
- DCHECK(host.empty() || host[0] != '.');
- DCHECK(host == parent_->origin().host());
- CookiePromptModalDialog::DialogType type = parent_->dialog_type();
+void CookiePromptView::InitializeViewResources() {
+ CookiePromptModalDialog::DialogType type = parent_->dialog_type();
title_ = l10n_util::GetStringF(
type == CookiePromptModalDialog::DIALOG_TYPE_COOKIE ?
IDS_COOKIE_ALERT_TITLE : IDS_DATA_ALERT_TITLE,
diff --git a/chrome/browser/views/cookie_prompt_view.h b/chrome/browser/views/cookie_prompt_view.h
index daeb2b4..933ec0c 100644
--- a/chrome/browser/views/cookie_prompt_view.h
+++ b/chrome/browser/views/cookie_prompt_view.h
@@ -86,7 +86,7 @@ class CookiePromptView : public views::View,
int GetExtendedViewHeight();
// Initializes text resources needed to display this view.
- void InitializeViewResources(const std::string& domain);
+ void InitializeViewResources();
views::RadioButton* remember_radio_;
views::RadioButton* ask_radio_;