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 322 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
333 url_, base::Bind(&SupervisedUserInterstitial::OnAccessRequestAdded, | 333 url_, base::Bind(&SupervisedUserInterstitial::OnAccessRequestAdded, |
334 weak_ptr_factory_.GetWeakPtr())); | 334 weak_ptr_factory_.GetWeakPtr())); |
335 return; | 335 return; |
336 } | 336 } |
337 | 337 |
338 if (command == "\"feedback\"") { | 338 if (command == "\"feedback\"") { |
339 base::string16 reason = l10n_util::GetStringUTF16( | 339 base::string16 reason = l10n_util::GetStringUTF16( |
340 SupervisedUserURLFilter::GetBlockMessageID(reason_)); | 340 SupervisedUserURLFilter::GetBlockMessageID(reason_)); |
341 std::string message = l10n_util::GetStringFUTF8( | 341 std::string message = l10n_util::GetStringFUTF8( |
342 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); | 342 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); |
343 #if defined(OS_ANDROID) | 343 #if defined(ANDROID_JAVA_UI) |
344 ReportChildAccountFeedback(web_contents_, message, url_); | 344 ReportChildAccountFeedback(web_contents_, message, url_); |
345 #else | 345 #else |
346 chrome::ShowFeedbackPage(chrome::FindBrowserWithWebContents(web_contents_), | 346 chrome::ShowFeedbackPage(chrome::FindBrowserWithWebContents(web_contents_), |
347 message, std::string()); | 347 message, std::string()); |
348 #endif | 348 #endif |
349 return; | 349 return; |
350 } | 350 } |
351 | 351 |
352 NOTREACHED(); | 352 NOTREACHED(); |
353 } | 353 } |
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
401 supervised_user_service->RemoveObserver(this); | 401 supervised_user_service->RemoveObserver(this); |
402 | 402 |
403 if (!callback_.is_null()) | 403 if (!callback_.is_null()) |
404 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 404 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
405 base::Bind(callback_, continue_request)); | 405 base::Bind(callback_, continue_request)); |
406 | 406 |
407 // After this, the WebContents may be destroyed. Make sure we don't try to use | 407 // After this, the WebContents may be destroyed. Make sure we don't try to use |
408 // it again. | 408 // it again. |
409 web_contents_ = NULL; | 409 web_contents_ = NULL; |
410 } | 410 } |
OLD | NEW |