OLD | NEW |
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 "build/build_config.h" | 9 #include "build/build_config.h" |
10 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" | 10 #include "chrome/browser/ui/website_settings/permission_bubble_request.h" |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
103 // page? We should maybe listen to DidStartNavigationToPendingEntry (and | 103 // page? We should maybe listen to DidStartNavigationToPendingEntry (and |
104 // any other renderer-side nav initiations?). Double-check this for | 104 // any other renderer-side nav initiations?). Double-check this for |
105 // correct behavior on interstitials -- we probably want to basically queue | 105 // correct behavior on interstitials -- we probably want to basically queue |
106 // any request for which GetVisibleURL != GetLastCommittedURL. | 106 // any request for which GetVisibleURL != GetLastCommittedURL. |
107 request_url_ = web_contents()->GetLastCommittedURL(); | 107 request_url_ = web_contents()->GetLastCommittedURL(); |
108 bool is_main_frame = | 108 bool is_main_frame = |
109 url::Origin(request_url_) | 109 url::Origin(request_url_) |
110 .IsSameOriginWith(url::Origin(request->GetRequestingHostname())); | 110 .IsSameOriginWith(url::Origin(request->GetRequestingHostname())); |
111 | 111 |
112 // Don't re-add an existing request or one with a duplicate text request. | 112 // Don't re-add an existing request or one with a duplicate text request. |
| 113 // TODO(johnme): Instead of dropping duplicate requests, we should queue them |
| 114 // and eventually run their PermissionGranted/PermissionDenied/Cancelled |
| 115 // callback (crbug.com/577313). |
113 bool same_object = false; | 116 bool same_object = false; |
114 if (ExistingRequest(request, requests_, &same_object) || | 117 if (ExistingRequest(request, requests_, &same_object) || |
115 ExistingRequest(request, queued_requests_, &same_object) || | 118 ExistingRequest(request, queued_requests_, &same_object) || |
116 ExistingRequest(request, queued_frame_requests_, &same_object)) { | 119 ExistingRequest(request, queued_frame_requests_, &same_object)) { |
117 if (!same_object) | 120 if (!same_object) |
118 request->RequestFinished(); | 121 request->RequestFinished(); |
119 return; | 122 return; |
120 } | 123 } |
121 | 124 |
122 if (IsBubbleVisible()) { | 125 if (IsBubbleVisible()) { |
(...skipping 324 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
447 case DENY_ALL: | 450 case DENY_ALL: |
448 Deny(); | 451 Deny(); |
449 break; | 452 break; |
450 case DISMISS: | 453 case DISMISS: |
451 Closing(); | 454 Closing(); |
452 break; | 455 break; |
453 case NONE: | 456 case NONE: |
454 NOTREACHED(); | 457 NOTREACHED(); |
455 } | 458 } |
456 } | 459 } |
OLD | NEW |