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 "base/memory/weak_ptr.h" | 7 #include "base/memory/weak_ptr.h" |
8 #include "base/metrics/histogram.h" | 8 #include "base/metrics/histogram.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
304 return; | 304 return; |
305 } | 305 } |
306 | 306 |
307 if (command == "\"request\"") { | 307 if (command == "\"request\"") { |
308 UMA_HISTOGRAM_ENUMERATION("ManagedMode.BlockingInterstitialCommand", | 308 UMA_HISTOGRAM_ENUMERATION("ManagedMode.BlockingInterstitialCommand", |
309 ACCESS_REQUEST, | 309 ACCESS_REQUEST, |
310 HISTOGRAM_BOUNDING_VALUE); | 310 HISTOGRAM_BOUNDING_VALUE); |
311 | 311 |
312 SupervisedUserService* supervised_user_service = | 312 SupervisedUserService* supervised_user_service = |
313 SupervisedUserServiceFactory::GetForProfile(profile_); | 313 SupervisedUserServiceFactory::GetForProfile(profile_); |
314 supervised_user_service->AddAccessRequest( | 314 supervised_user_service->AddURLAccessRequest( |
315 url_, base::Bind(&SupervisedUserInterstitial::OnAccessRequestAdded, | 315 url_, base::Bind(&SupervisedUserInterstitial::OnAccessRequestAdded, |
316 weak_ptr_factory_.GetWeakPtr())); | 316 weak_ptr_factory_.GetWeakPtr())); |
317 return; | 317 return; |
318 } | 318 } |
319 | 319 |
320 if (command == "\"feedback\"") { | 320 if (command == "\"feedback\"") { |
321 base::string16 reason = l10n_util::GetStringUTF16( | 321 base::string16 reason = l10n_util::GetStringUTF16( |
322 SupervisedUserURLFilter::GetBlockMessageID(reason_)); | 322 SupervisedUserURLFilter::GetBlockMessageID(reason_)); |
323 std::string message = l10n_util::GetStringFUTF8( | 323 std::string message = l10n_util::GetStringFUTF8( |
324 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); | 324 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
385 SupervisedUserServiceFactory::GetForProfile(profile_); | 385 SupervisedUserServiceFactory::GetForProfile(profile_); |
386 supervised_user_service->RemoveObserver(this); | 386 supervised_user_service->RemoveObserver(this); |
387 | 387 |
388 BrowserThread::PostTask( | 388 BrowserThread::PostTask( |
389 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 389 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
390 | 390 |
391 // After this, the WebContents may be destroyed. Make sure we don't try to use | 391 // After this, the WebContents may be destroyed. Make sure we don't try to use |
392 // it again. | 392 // it again. |
393 web_contents_ = NULL; | 393 web_contents_ = NULL; |
394 } | 394 } |
OLD | NEW |