| Index: chrome/browser/supervised_user/supervised_user_resource_throttle.cc
|
| diff --git a/chrome/browser/managed_mode/managed_mode_resource_throttle.cc b/chrome/browser/supervised_user/supervised_user_resource_throttle.cc
|
| similarity index 47%
|
| rename from chrome/browser/managed_mode/managed_mode_resource_throttle.cc
|
| rename to chrome/browser/supervised_user/supervised_user_resource_throttle.cc
|
| index 001508db5b8a30456f08df7f9c99ce4e9323df4f..17fc638534c3d6ff3f8980e7e1299d39df90099d 100644
|
| --- a/chrome/browser/managed_mode/managed_mode_resource_throttle.cc
|
| +++ b/chrome/browser/supervised_user/supervised_user_resource_throttle.cc
|
| @@ -2,12 +2,12 @@
|
| // Use of this source code is governed by a BSD-style license that can be
|
| // found in the LICENSE file.
|
|
|
| -#include "chrome/browser/managed_mode/managed_mode_resource_throttle.h"
|
| +#include "chrome/browser/supervised_user/supervised_user_resource_throttle.h"
|
|
|
| #include "base/bind.h"
|
| -#include "chrome/browser/managed_mode/managed_mode_interstitial.h"
|
| -#include "chrome/browser/managed_mode/managed_mode_navigation_observer.h"
|
| -#include "chrome/browser/managed_mode/managed_mode_url_filter.h"
|
| +#include "chrome/browser/supervised_user/supervised_user_interstitial.h"
|
| +#include "chrome/browser/supervised_user/supervised_user_navigation_observer.h"
|
| +#include "chrome/browser/supervised_user/supervised_user_url_filter.h"
|
| #include "content/public/browser/browser_thread.h"
|
| #include "content/public/browser/resource_controller.h"
|
| #include "content/public/browser/resource_request_info.h"
|
| @@ -15,26 +15,26 @@
|
|
|
| using content::BrowserThread;
|
|
|
| -ManagedModeResourceThrottle::ManagedModeResourceThrottle(
|
| +SupervisedUserResourceThrottle::SupervisedUserResourceThrottle(
|
| const net::URLRequest* request,
|
| bool is_main_frame,
|
| - const ManagedModeURLFilter* url_filter)
|
| + const SupervisedUserURLFilter* url_filter)
|
| : request_(request),
|
| is_main_frame_(is_main_frame),
|
| url_filter_(url_filter),
|
| weak_ptr_factory_(this) {}
|
|
|
| -ManagedModeResourceThrottle::~ManagedModeResourceThrottle() {}
|
| +SupervisedUserResourceThrottle::~SupervisedUserResourceThrottle() {}
|
|
|
| -void ManagedModeResourceThrottle::ShowInterstitialIfNeeded(bool is_redirect,
|
| - const GURL& url,
|
| - bool* defer) {
|
| +void SupervisedUserResourceThrottle::ShowInterstitialIfNeeded(bool is_redirect,
|
| + const GURL& url,
|
| + bool* defer) {
|
| // Only treat main frame requests for now (ignoring subresources).
|
| if (!is_main_frame_)
|
| return;
|
|
|
| if (url_filter_->GetFilteringBehaviorForURL(url) !=
|
| - ManagedModeURLFilter::BLOCK) {
|
| + SupervisedUserURLFilter::BLOCK) {
|
| return;
|
| }
|
|
|
| @@ -42,26 +42,28 @@ void ManagedModeResourceThrottle::ShowInterstitialIfNeeded(bool is_redirect,
|
| const content::ResourceRequestInfo* info =
|
| content::ResourceRequestInfo::ForRequest(request_);
|
| BrowserThread::PostTask(BrowserThread::UI, FROM_HERE,
|
| - base::Bind(&ManagedModeNavigationObserver::OnRequestBlocked,
|
| + base::Bind(&SupervisedUserNavigationObserver::OnRequestBlocked,
|
| info->GetChildID(), info->GetRouteID(), url,
|
| - base::Bind(&ManagedModeResourceThrottle::OnInterstitialResult,
|
| - weak_ptr_factory_.GetWeakPtr())));
|
| + base::Bind(
|
| + &SupervisedUserResourceThrottle::OnInterstitialResult,
|
| + weak_ptr_factory_.GetWeakPtr())));
|
| }
|
|
|
| -void ManagedModeResourceThrottle::WillStartRequest(bool* defer) {
|
| +void SupervisedUserResourceThrottle::WillStartRequest(bool* defer) {
|
| ShowInterstitialIfNeeded(false, request_->url(), defer);
|
| }
|
|
|
| -void ManagedModeResourceThrottle::WillRedirectRequest(const GURL& new_url,
|
| - bool* defer) {
|
| +void SupervisedUserResourceThrottle::WillRedirectRequest(const GURL& new_url,
|
| + bool* defer) {
|
| ShowInterstitialIfNeeded(true, new_url, defer);
|
| }
|
|
|
| -const char* ManagedModeResourceThrottle::GetNameForLogging() const {
|
| - return "ManagedModeResourceThrottle";
|
| +const char* SupervisedUserResourceThrottle::GetNameForLogging() const {
|
| + return "SupervisedUserResourceThrottle";
|
| }
|
|
|
| -void ManagedModeResourceThrottle::OnInterstitialResult(bool continue_request) {
|
| +void SupervisedUserResourceThrottle::OnInterstitialResult(
|
| + bool continue_request) {
|
| if (continue_request)
|
| controller()->Resume();
|
| else
|
|
|