| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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/exclusive_access/exclusive_access_controller_base.h" | 5 #include "chrome/browser/ui/exclusive_access/exclusive_access_controller_base.h" |
| 6 | 6 |
| 7 #include "chrome/browser/chrome_notification_types.h" | 7 #include "chrome/browser/chrome_notification_types.h" |
| 8 #include "chrome/browser/profiles/profile.h" | 8 #include "chrome/browser/profiles/profile.h" |
| 9 #include "chrome/browser/ui/browser.h" | 9 #include "chrome/browser/ui/exclusive_access/exclusive_access_manager.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | |
| 11 #include "content/public/browser/navigation_details.h" | 10 #include "content/public/browser/navigation_details.h" |
| 12 #include "content/public/browser/navigation_entry.h" | 11 #include "content/public/browser/navigation_entry.h" |
| 13 #include "content/public/browser/notification_service.h" | 12 #include "content/public/browser/notification_service.h" |
| 14 #include "content/public/browser/web_contents.h" | 13 #include "content/public/browser/web_contents.h" |
| 15 | 14 |
| 16 using content::WebContents; | 15 using content::WebContents; |
| 17 | 16 |
| 18 ExclusiveAccessControllerBase::ExclusiveAccessControllerBase( | 17 ExclusiveAccessControllerBase::ExclusiveAccessControllerBase( |
| 19 ExclusiveAccessManager* manager) | 18 ExclusiveAccessManager* manager) |
| 20 : manager_(manager), tab_with_exclusive_access_(nullptr) { | 19 : manager_(manager), tab_with_exclusive_access_(nullptr) { |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 | 78 |
| 80 void ExclusiveAccessControllerBase::UpdateNotificationRegistrations() { | 79 void ExclusiveAccessControllerBase::UpdateNotificationRegistrations() { |
| 81 if (tab_with_exclusive_access_ && registrar_.IsEmpty()) { | 80 if (tab_with_exclusive_access_ && registrar_.IsEmpty()) { |
| 82 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, | 81 registrar_.Add(this, content::NOTIFICATION_NAV_ENTRY_COMMITTED, |
| 83 content::Source<content::NavigationController>( | 82 content::Source<content::NavigationController>( |
| 84 &tab_with_exclusive_access_->GetController())); | 83 &tab_with_exclusive_access_->GetController())); |
| 85 } else if (!tab_with_exclusive_access_ && !registrar_.IsEmpty()) { | 84 } else if (!tab_with_exclusive_access_ && !registrar_.IsEmpty()) { |
| 86 registrar_.RemoveAll(); | 85 registrar_.RemoveAll(); |
| 87 } | 86 } |
| 88 } | 87 } |
| OLD | NEW |