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

Side by Side Diff: chrome/browser/net/chrome_cookie_policy.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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « chrome/browser/message_box_handler.cc ('k') | chrome/browser/views/cookie_info_view.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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/net/chrome_cookie_policy.h" 5 #include "chrome/browser/net/chrome_cookie_policy.h"
6 6
7 #include "base/string_util.h" 7 #include "base/string_util.h"
8 #include "chrome/browser/browser_list.h" 8 #include "chrome/browser/browser_list.h"
9 #include "chrome/browser/chrome_thread.h" 9 #include "chrome/browser/chrome_thread.h"
10 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h" 10 #include "chrome/browser/cookie_prompt_modal_dialog_delegate.h"
(...skipping 145 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 } 156 }
157 157
158 // Show the prompt on top of the current tab. 158 // Show the prompt on top of the current tab.
159 Browser* browser = BrowserList::GetLastActive(); 159 Browser* browser = BrowserList::GetLastActive();
160 if (!browser || !browser->GetSelectedTabContents()) { 160 if (!browser || !browser->GetSelectedTabContents()) {
161 DidPromptForSetCookie(host, net::ERR_ACCESS_DENIED, false); 161 DidPromptForSetCookie(host, net::ERR_ACCESS_DENIED, false);
162 return; 162 return;
163 } 163 }
164 164
165 #if defined(OS_WIN) 165 #if defined(OS_WIN)
166 RunCookiePrompt(browser->GetSelectedTabContents(), host, data.cookie_line, 166 RunCookiePrompt(browser->GetSelectedTabContents(), data.url, data.cookie_line,
167 new PromptDelegate(this, host)); 167 new PromptDelegate(this, host));
168 #else 168 #else
169 // TODO(darin): Enable prompting for other ports. 169 // TODO(darin): Enable prompting for other ports.
170 DidPromptForSetCookie(host, net::ERR_ACCESS_DENIED, false); 170 DidPromptForSetCookie(host, net::ERR_ACCESS_DENIED, false);
171 #endif 171 #endif
172 } 172 }
173 173
174 void ChromeCookiePolicy::PromptForSetCookie(const GURL& url, 174 void ChromeCookiePolicy::PromptForSetCookie(const GURL& url,
175 const std::string& cookie_line) { 175 const std::string& cookie_line) {
176 if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) { 176 if (!ChromeThread::CurrentlyOn(ChromeThread::UI)) {
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after
234 callbacks.push_back(completions[i].callback()); 234 callbacks.push_back(completions[i].callback());
235 } 235 }
236 completions.erase(completions.begin(), completions.begin() + i); 236 completions.erase(completions.begin(), completions.begin() + i);
237 237
238 if (completions.empty()) 238 if (completions.empty())
239 host_completions_map_.erase(it); 239 host_completions_map_.erase(it);
240 240
241 for (size_t j = 0; j < callbacks.size(); ++j) 241 for (size_t j = 0; j < callbacks.size(); ++j)
242 callbacks[j]->Run(policy); 242 callbacks[j]->Run(policy);
243 } 243 }
OLDNEW
« no previous file with comments | « chrome/browser/message_box_handler.cc ('k') | chrome/browser/views/cookie_info_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698