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

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

Issue 2403763003: [Mac] Address buggy permission bubble behaviour on dismissal via ESC. (Closed)
Patch Set: Override [cancel] instead of [dealloc] Created 4 years, 2 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
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 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ 5 #ifndef CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_
6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ 6 #define CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_
7 7
8 #include <unordered_map> 8 #include <unordered_map>
9 #include <vector> 9 #include <vector>
10 10
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
63 63
64 // Cancels an outstanding request. This may have different effects depending 64 // Cancels an outstanding request. This may have different effects depending
65 // on what is going on with the bubble. If the request is pending, it will be 65 // on what is going on with the bubble. If the request is pending, it will be
66 // removed and never shown. If the request is showing, it will continue to be 66 // removed and never shown. If the request is showing, it will continue to be
67 // shown, but the user's action won't be reported back to the request object. 67 // shown, but the user's action won't be reported back to the request object.
68 // In some circumstances, we can remove the request from the bubble, and may 68 // In some circumstances, we can remove the request from the bubble, and may
69 // do so. The request will have RequestFinished executed on it if it is found, 69 // do so. The request will have RequestFinished executed on it if it is found,
70 // at which time the caller is free to delete the request. 70 // at which time the caller is free to delete the request.
71 void CancelRequest(PermissionRequest* request); 71 void CancelRequest(PermissionRequest* request);
72 72
73 // Hides the bubble. 73 // Dismisses the bubble if it is visible, as if the user had clicked the X in
74 // the prompt. Then hides the bubble and destroys the UI surface.
75 void DismissBubble();
76
77 // Hides the bubble, and destroys the UI surface used to display the
78 // permission requests. DisplayPendingRequests or a navigation must occur
79 // before another bubble will be shown.
74 void HideBubble(); 80 void HideBubble();
felt 2016/10/10 18:21:00 Do we *ever* want this behavior? Should we get rid
hcarmona 2016/10/10 18:28:51 |HideBubble| is used when switching tabs to hide t
dominickn 2016/10/10 22:55:48 I clarified the comment here.
hcarmona 2016/10/11 14:45:33 Thanks!
75 81
76 // Will show a permission bubble if there is a pending permission request on 82 // Will show a permission bubble if there is a pending permission request on
77 // the web contents that the PermissionRequestManager belongs to. 83 // the web contents that the PermissionRequestManager belongs to.
78 void DisplayPendingRequests(); 84 void DisplayPendingRequests();
79 85
80 // Will reposition the bubble (may change parent if necessary). 86 // Will reposition the bubble (may change parent if necessary).
81 void UpdateAnchorPosition(); 87 void UpdateAnchorPosition();
82 88
83 // True if a permission bubble is currently visible. 89 // True if a permission bubble is currently visible.
84 // TODO(hcarmona): Remove this as part of the bubble API work. 90 // TODO(hcarmona): Remove this as part of the bubble API work.
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
193 // Whether each of the requests in |requests_| is accepted by the user. 199 // Whether each of the requests in |requests_| is accepted by the user.
194 std::vector<bool> accept_states_; 200 std::vector<bool> accept_states_;
195 201
196 base::ObserverList<Observer> observer_list_; 202 base::ObserverList<Observer> observer_list_;
197 AutoResponseType auto_response_for_test_; 203 AutoResponseType auto_response_for_test_;
198 204
199 base::WeakPtrFactory<PermissionRequestManager> weak_factory_; 205 base::WeakPtrFactory<PermissionRequestManager> weak_factory_;
200 }; 206 };
201 207
202 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_ 208 #endif // CHROME_BROWSER_PERMISSIONS_PERMISSION_REQUEST_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698