| 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 "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 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 216 request_url_has_loaded_ = true; | 216 request_url_has_loaded_ = true; |
| 217 // This is scheduled because while all calls to the browser have been | 217 // This is scheduled because while all calls to the browser have been |
| 218 // issued at DOMContentLoaded, they may be bouncing around in scheduled | 218 // issued at DOMContentLoaded, they may be bouncing around in scheduled |
| 219 // callbacks finding the UI thread still. This makes sure we allow those | 219 // callbacks finding the UI thread still. This makes sure we allow those |
| 220 // scheduled calls to AddRequest to complete before we show the page-load | 220 // scheduled calls to AddRequest to complete before we show the page-load |
| 221 // permissions bubble. | 221 // permissions bubble. |
| 222 ScheduleShowBubble(); | 222 ScheduleShowBubble(); |
| 223 } | 223 } |
| 224 | 224 |
| 225 void PermissionBubbleManager::DocumentLoadedInFrame( | 225 void PermissionBubbleManager::DocumentLoadedInFrame( |
| 226 int64 frame_id, | 226 content::RenderFrameHost* render_frame_host) { |
| 227 content::RenderViewHost* render_view_host) { | |
| 228 if (request_url_has_loaded_) | 227 if (request_url_has_loaded_) |
| 229 ScheduleShowBubble(); | 228 ScheduleShowBubble(); |
| 230 } | 229 } |
| 231 | 230 |
| 232 void PermissionBubbleManager::NavigationEntryCommitted( | 231 void PermissionBubbleManager::NavigationEntryCommitted( |
| 233 const content::LoadCommittedDetails& details) { | 232 const content::LoadCommittedDetails& details) { |
| 234 // No permissions requests pending. | 233 // No permissions requests pending. |
| 235 if (request_url_.is_empty()) | 234 if (request_url_.is_empty()) |
| 236 return; | 235 return; |
| 237 | 236 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 408 bool PermissionBubbleManager::HasUserGestureRequest( | 407 bool PermissionBubbleManager::HasUserGestureRequest( |
| 409 const std::vector<PermissionBubbleRequest*>& queue) { | 408 const std::vector<PermissionBubbleRequest*>& queue) { |
| 410 std::vector<PermissionBubbleRequest*>::const_iterator iter; | 409 std::vector<PermissionBubbleRequest*>::const_iterator iter; |
| 411 for (iter = queue.begin(); iter != queue.end(); iter++) { | 410 for (iter = queue.begin(); iter != queue.end(); iter++) { |
| 412 if ((*iter)->HasUserGesture()) | 411 if ((*iter)->HasUserGesture()) |
| 413 return true; | 412 return true; |
| 414 } | 413 } |
| 415 return false; | 414 return false; |
| 416 } | 415 } |
| 417 | 416 |
| OLD | NEW |