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

Side by Side Diff: chrome/browser/permissions/permission_request_manager.cc

Issue 2403763003: [Mac] Address buggy permission bubble behaviour on dismissal via ESC. (Closed)
Patch Set: Comments Created 4 years, 1 month 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
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/permissions/permission_request_manager.h" 5 #include "chrome/browser/permissions/permission_request_manager.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/user_metrics_action.h" 10 #include "base/metrics/user_metrics_action.h"
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
216 if (request == it->second) { 216 if (request == it->second) {
217 it->second->RequestFinished(); 217 it->second->RequestFinished();
218 duplicate_requests_.erase(it); 218 duplicate_requests_.erase(it);
219 return; 219 return;
220 } 220 }
221 } 221 }
222 222
223 NOTREACHED(); // Callers should not cancel requests that are not pending. 223 NOTREACHED(); // Callers should not cancel requests that are not pending.
224 } 224 }
225 225
226 void PermissionRequestManager::DismissBubble() {
227 if (IsBubbleVisible())
raymes 2016/10/27 01:47:52 Do you know why this check is needed? Should we ju
dominickn 2016/10/27 02:09:02 That was the exact question I posed to felt@, whet
raymes 2016/10/27 02:26:39 Do you know whether IsBubbleVisible call is needed
228 Closing();
229 }
230
226 void PermissionRequestManager::HideBubble() { 231 void PermissionRequestManager::HideBubble() {
227 // Disengage from the existing view if there is one. 232 // Disengage from the existing view if there is one.
228 if (!view_) 233 if (!view_)
229 return; 234 return;
230 235
231 view_->SetDelegate(nullptr); 236 view_->SetDelegate(nullptr);
232 view_->Hide(); 237 view_->Hide();
233 view_.reset(); 238 view_.reset();
234 } 239 }
235 240
(...skipping 278 matching lines...) Expand 10 before | Expand all | Expand 10 after
514 case DENY_ALL: 519 case DENY_ALL:
515 Deny(); 520 Deny();
516 break; 521 break;
517 case DISMISS: 522 case DISMISS:
518 Closing(); 523 Closing();
519 break; 524 break;
520 case NONE: 525 case NONE:
521 NOTREACHED(); 526 NOTREACHED();
522 } 527 }
523 } 528 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698