Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(534)

Unified Diff: chrome/browser/views/cookie_prompt_view.cc

Issue 597031: Avoid showing the user a garbage path attribute when the cookie doesn't have ... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/views/cookie_prompt_view.h ('k') | net/base/cookie_monster.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/views/cookie_prompt_view.cc
===================================================================
--- chrome/browser/views/cookie_prompt_view.cc (revision 38820)
+++ chrome/browser/views/cookie_prompt_view.cc (working copy)
@@ -42,7 +42,7 @@
gfx::NativeWindow root_window,
Profile* profile,
const BrowsingDataLocalStorageHelper::LocalStorageInfo& storage_info,
- const std::string& host,
+ const GURL& url,
const std::string& cookie_line,
CookiePromptModalDialogDelegate* delegate,
bool cookie_ui)
@@ -58,11 +58,11 @@
cookie_ui_(cookie_ui),
parent_(parent),
root_window_(root_window),
- host_(host),
+ url_(url),
cookie_line_(cookie_line),
local_storage_info_(storage_info),
delegate_(delegate) {
- InitializeViewResources(host);
+ InitializeViewResources();
expanded_view_ = g_browser_process->local_state()->
GetBoolean(prefs::kCookiePromptExpanded);
}
@@ -242,7 +242,7 @@
layout->AddView(cookie_info_view, 1, 1, GridLayout::FILL,
GridLayout::CENTER);
- cookie_info_view->SetCookieString(host_, cookie_line_);
+ cookie_info_view->SetCookieString(url_, cookie_line_);
info_view_ = cookie_info_view;
} else {
LocalStorageInfoView* local_storage_info_view = new LocalStorageInfoView();
@@ -282,9 +282,8 @@
window->SetBounds(bounds, NULL);
}
-void CookiePromptView::InitializeViewResources(const std::string& host) {
- DCHECK(host.empty() || host[0] != '.');
- host_ = host;
+void CookiePromptView::InitializeViewResources() {
+ host_ = cookie_ui_ ? url_.host() : local_storage_info_.host;
title_ = l10n_util::GetStringF(
cookie_ui_ ? IDS_COOKIE_ALERT_TITLE : IDS_DATA_ALERT_TITLE,
UTF8ToWide(host_));
« no previous file with comments | « chrome/browser/views/cookie_prompt_view.h ('k') | net/base/cookie_monster.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698