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

Side by Side Diff: chrome/browser/ui/website_settings/permission_bubble_manager.cc

Issue 1266003004: Do not expire permission bubbles for in-page navigations. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/website_settings/permission_bubble_manager.h" 5 #include "chrome/browser/ui/website_settings/permission_bubble_manager.h"
6 6
7 #include "base/command_line.h" 7 #include "base/command_line.h"
8 #include "base/metrics/user_metrics_action.h" 8 #include "base/metrics/user_metrics_action.h"
9 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" 9 #include "chrome/browser/ui/website_settings/permission_bubble_request.h"
10 #include "chrome/common/chrome_switches.h" 10 #include "chrome/common/chrome_switches.h"
(...skipping 255 matching lines...) Expand 10 before | Expand all | Expand 10 after
266 const content::LoadCommittedDetails& details) { 266 const content::LoadCommittedDetails& details) {
267 // No permissions requests pending. 267 // No permissions requests pending.
268 if (request_url_.is_empty()) 268 if (request_url_.is_empty())
269 return; 269 return;
270 270
271 // If we have navigated to a new url or reloaded the page... 271 // If we have navigated to a new url or reloaded the page...
272 // GetAsReferrer strips fragment and username/password, meaning 272 // GetAsReferrer strips fragment and username/password, meaning
273 // the navigation is really to the same page. 273 // the navigation is really to the same page.
274 if ((request_url_.GetAsReferrer() != 274 if ((request_url_.GetAsReferrer() !=
275 web_contents()->GetLastCommittedURL().GetAsReferrer()) || 275 web_contents()->GetLastCommittedURL().GetAsReferrer()) ||
276 details.type == content::NAVIGATION_TYPE_EXISTING_PAGE) { 276 (details.type == content::NAVIGATION_TYPE_EXISTING_PAGE &&
277 !details.is_in_page)) {
mlamouri (slow - plz ping) 2015/08/04 11:56:38 Why not use ::DidNavigateAnyFrame() to merge this
Avi (use Gerrit) 2015/08/04 14:28:16 Because I don't know this code well, and I was try
hcarmona 2015/08/04 23:10:44 It looks like using GetAsReferrer to compare the r
Avi (use Gerrit) 2015/08/05 15:11:48 But that's different behavior. The bug calls out g
hcarmona 2015/08/05 18:51:04 Interesting. I didn't know there were cases where
277 // Kill off existing bubble and cancel any pending requests. 278 // Kill off existing bubble and cancel any pending requests.
278 CancelPendingQueues(); 279 CancelPendingQueues();
279 FinalizeBubble(); 280 FinalizeBubble();
280 } 281 }
281 } 282 }
282 283
283 void PermissionBubbleManager::WebContentsDestroyed() { 284 void PermissionBubbleManager::WebContentsDestroyed() {
284 // If the web contents has been destroyed, treat the bubble as cancelled. 285 // If the web contents has been destroyed, treat the bubble as cancelled.
285 CancelPendingQueues(); 286 CancelPendingQueues();
286 FinalizeBubble(); 287 FinalizeBubble();
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
468 case DENY_ALL: 469 case DENY_ALL:
469 Deny(); 470 Deny();
470 break; 471 break;
471 case DISMISS: 472 case DISMISS:
472 Closing(); 473 Closing();
473 break; 474 break;
474 case NONE: 475 case NONE:
475 NOTREACHED(); 476 NOTREACHED();
476 } 477 }
477 } 478 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698