| 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/supervised_user/supervised_user_interstitial.h" | 5 #include "chrome/browser/supervised_user/supervised_user_interstitial.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include "base/memory/weak_ptr.h" | 9 #include "base/memory/weak_ptr.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 159 // default true. This results in is_navigation_to_different_page() returning | 159 // default true. This results in is_navigation_to_different_page() returning |
| 160 // true. | 160 // true. |
| 161 DCHECK(details.is_navigation_to_different_page()); | 161 DCHECK(details.is_navigation_to_different_page()); |
| 162 const content::NavigationController& controller = | 162 const content::NavigationController& controller = |
| 163 web_contents_->GetController(); | 163 web_contents_->GetController(); |
| 164 details.entry = controller.GetActiveEntry(); | 164 details.entry = controller.GetActiveEntry(); |
| 165 if (controller.GetLastCommittedEntry()) { | 165 if (controller.GetLastCommittedEntry()) { |
| 166 details.previous_entry_index = controller.GetLastCommittedEntryIndex(); | 166 details.previous_entry_index = controller.GetLastCommittedEntryIndex(); |
| 167 details.previous_url = controller.GetLastCommittedEntry()->GetURL(); | 167 details.previous_url = controller.GetLastCommittedEntry()->GetURL(); |
| 168 } | 168 } |
| 169 details.type = content::NAVIGATION_TYPE_NEW_PAGE; | 169 details.type = content::NavigationType::NEW_PAGE; |
| 170 for (int i = service->infobar_count() - 1; i >= 0; --i) { | 170 for (int i = service->infobar_count() - 1; i >= 0; --i) { |
| 171 infobars::InfoBar* infobar = service->infobar_at(i); | 171 infobars::InfoBar* infobar = service->infobar_at(i); |
| 172 if (infobar->delegate()->ShouldExpire( | 172 if (infobar->delegate()->ShouldExpire( |
| 173 InfoBarService::NavigationDetailsFromLoadCommittedDetails( | 173 InfoBarService::NavigationDetailsFromLoadCommittedDetails( |
| 174 details))) | 174 details))) |
| 175 service->RemoveInfoBar(infobar); | 175 service->RemoveInfoBar(infobar); |
| 176 } | 176 } |
| 177 } | 177 } |
| 178 | 178 |
| 179 SupervisedUserService* supervised_user_service = | 179 SupervisedUserService* supervised_user_service = |
| (...skipping 151 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 331 supervised_user_service->RemoveObserver(this); | 331 supervised_user_service->RemoveObserver(this); |
| 332 | 332 |
| 333 if (!callback_.is_null()) | 333 if (!callback_.is_null()) |
| 334 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 334 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 335 base::Bind(callback_, continue_request)); | 335 base::Bind(callback_, continue_request)); |
| 336 | 336 |
| 337 // After this, the WebContents may be destroyed. Make sure we don't try to use | 337 // After this, the WebContents may be destroyed. Make sure we don't try to use |
| 338 // it again. | 338 // it again. |
| 339 web_contents_ = NULL; | 339 web_contents_ = NULL; |
| 340 } | 340 } |
| OLD | NEW |