| 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_navigation_observer.h" | 5 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 163 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 174 } | 174 } |
| 175 | 175 |
| 176 void SupervisedUserNavigationObserver::WarnInfoBarDismissed() { | 176 void SupervisedUserNavigationObserver::WarnInfoBarDismissed() { |
| 177 DCHECK(warn_infobar_); | 177 DCHECK(warn_infobar_); |
| 178 warn_infobar_ = NULL; | 178 warn_infobar_ = NULL; |
| 179 } | 179 } |
| 180 | 180 |
| 181 void SupervisedUserNavigationObserver::DidCommitProvisionalLoadForFrame( | 181 void SupervisedUserNavigationObserver::DidCommitProvisionalLoadForFrame( |
| 182 content::RenderFrameHost* render_frame_host, | 182 content::RenderFrameHost* render_frame_host, |
| 183 const GURL& url, | 183 const GURL& url, |
| 184 bool url_is_unreachable, |
| 184 ui::PageTransition transition_type) { | 185 ui::PageTransition transition_type) { |
| 185 if (render_frame_host->GetParent()) | 186 if (render_frame_host->GetParent()) |
| 186 return; | 187 return; |
| 187 | 188 |
| 188 DVLOG(1) << "DidCommitProvisionalLoadForFrame " << url.spec(); | 189 DVLOG(1) << "DidCommitProvisionalLoadForFrame " << url.spec(); |
| 189 SupervisedUserURLFilter::FilteringBehavior behavior = | 190 SupervisedUserURLFilter::FilteringBehavior behavior = |
| 190 url_filter_->GetFilteringBehaviorForURL(url); | 191 url_filter_->GetFilteringBehaviorForURL(url); |
| 191 | 192 |
| 192 if (behavior == SupervisedUserURLFilter::WARN && !warn_infobar_) { | 193 if (behavior == SupervisedUserURLFilter::WARN && !warn_infobar_) { |
| 193 warn_infobar_ = SupervisedUserWarningInfoBarDelegate::Create( | 194 warn_infobar_ = SupervisedUserWarningInfoBarDelegate::Create( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 history_service->AddPage(add_page_args); | 244 history_service->AddPage(add_page_args); |
| 244 | 245 |
| 245 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); | 246 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); |
| 246 entry->SetVirtualURL(url); | 247 entry->SetVirtualURL(url); |
| 247 entry->SetTimestamp(timestamp); | 248 entry->SetTimestamp(timestamp); |
| 248 blocked_navigations_.push_back(entry.release()); | 249 blocked_navigations_.push_back(entry.release()); |
| 249 SupervisedUserService* supervised_user_service = | 250 SupervisedUserService* supervised_user_service = |
| 250 SupervisedUserServiceFactory::GetForProfile(profile); | 251 SupervisedUserServiceFactory::GetForProfile(profile); |
| 251 supervised_user_service->DidBlockNavigation(web_contents()); | 252 supervised_user_service->DidBlockNavigation(web_contents()); |
| 252 } | 253 } |
| OLD | NEW |