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_macros.h" | 10 #include "base/metrics/histogram_macros.h" |
(...skipping 249 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
260 base::string16 second_custodian = | 260 base::string16 second_custodian = |
261 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); | 261 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); |
262 | 262 |
263 if (command == "\"feedback\"") { | 263 if (command == "\"feedback\"") { |
264 base::string16 reason = | 264 base::string16 reason = |
265 l10n_util::GetStringUTF16(supervised_user_error_page::GetBlockMessageID( | 265 l10n_util::GetStringUTF16(supervised_user_error_page::GetBlockMessageID( |
266 reason_, true, second_custodian.empty())); | 266 reason_, true, second_custodian.empty())); |
267 std::string message = l10n_util::GetStringFUTF8( | 267 std::string message = l10n_util::GetStringFUTF8( |
268 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); | 268 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); |
269 #if defined(OS_ANDROID) | 269 #if defined(OS_ANDROID) |
| 270 DCHECK(profile_->IsChild()); |
270 ReportChildAccountFeedback(web_contents_, message, url_); | 271 ReportChildAccountFeedback(web_contents_, message, url_); |
271 #else | 272 #else |
272 chrome::ShowFeedbackPage(chrome::FindBrowserWithWebContents(web_contents_), | 273 chrome::ShowFeedbackPage(chrome::FindBrowserWithWebContents(web_contents_), |
273 message, std::string()); | 274 message, std::string()); |
274 #endif | 275 #endif |
275 return; | 276 return; |
276 } | 277 } |
277 | 278 |
278 NOTREACHED(); | 279 NOTREACHED(); |
279 } | 280 } |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
346 SupervisedUserServiceFactory::GetForProfile(profile_); | 347 SupervisedUserServiceFactory::GetForProfile(profile_); |
347 supervised_user_service->RemoveObserver(this); | 348 supervised_user_service->RemoveObserver(this); |
348 | 349 |
349 if (!callback_.is_null()) | 350 if (!callback_.is_null()) |
350 callback_.Run(continue_request); | 351 callback_.Run(continue_request); |
351 | 352 |
352 // After this, the WebContents may be destroyed. Make sure we don't try to use | 353 // After this, the WebContents may be destroyed. Make sure we don't try to use |
353 // it again. | 354 // it again. |
354 web_contents_ = nullptr; | 355 web_contents_ = nullptr; |
355 } | 356 } |
OLD | NEW |