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/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/feature_list.h" | 10 #include "base/feature_list.h" |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
362 FinalizeBubble(); | 362 FinalizeBubble(); |
363 } | 363 } |
364 | 364 |
365 void PermissionRequestManager::ScheduleShowBubble() { | 365 void PermissionRequestManager::ScheduleShowBubble() { |
366 // ::ScheduleShowBubble() will be called again when the main frame will be | 366 // ::ScheduleShowBubble() will be called again when the main frame will be |
367 // loaded. | 367 // loaded. |
368 if (!main_frame_has_fully_loaded_) | 368 if (!main_frame_has_fully_loaded_) |
369 return; | 369 return; |
370 | 370 |
371 content::BrowserThread::PostTask( | 371 content::BrowserThread::PostTask( |
372 content::BrowserThread::UI, | 372 content::BrowserThread::UI, FROM_HERE, |
373 FROM_HERE, | 373 base::BindOnce(&PermissionRequestManager::TriggerShowBubble, |
374 base::Bind(&PermissionRequestManager::TriggerShowBubble, | 374 weak_factory_.GetWeakPtr())); |
375 weak_factory_.GetWeakPtr())); | |
376 } | 375 } |
377 | 376 |
378 void PermissionRequestManager::TriggerShowBubble() { | 377 void PermissionRequestManager::TriggerShowBubble() { |
379 if (!view_) | 378 if (!view_) |
380 return; | 379 return; |
381 if (IsBubbleVisible()) | 380 if (IsBubbleVisible()) |
382 return; | 381 return; |
383 if (!main_frame_has_fully_loaded_) | 382 if (!main_frame_has_fully_loaded_) |
384 return; | 383 return; |
385 if (requests_.empty() && queued_requests_.empty() && | 384 if (requests_.empty() && queued_requests_.empty() && |
(...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
527 case DENY_ALL: | 526 case DENY_ALL: |
528 Deny(); | 527 Deny(); |
529 break; | 528 break; |
530 case DISMISS: | 529 case DISMISS: |
531 Closing(); | 530 Closing(); |
532 break; | 531 break; |
533 case NONE: | 532 case NONE: |
534 NOTREACHED(); | 533 NOTREACHED(); |
535 } | 534 } |
536 } | 535 } |
OLD | NEW |