Chromium Code Reviews| 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 21 matching lines...) Expand all Loading... | |
| 32 #include "content/public/browser/render_frame_host.h" | 32 #include "content/public/browser/render_frame_host.h" |
| 33 #include "content/public/browser/render_view_host.h" | 33 #include "content/public/browser/render_view_host.h" |
| 34 #include "content/public/browser/web_contents.h" | 34 #include "content/public/browser/web_contents.h" |
| 35 #include "content/public/browser/web_contents_user_data.h" | 35 #include "content/public/browser/web_contents_user_data.h" |
| 36 #include "content/public/browser/web_ui.h" | 36 #include "content/public/browser/web_ui.h" |
| 37 #include "ui/base/l10n/l10n_util.h" | 37 #include "ui/base/l10n/l10n_util.h" |
| 38 #include "ui/base/resource/resource_bundle.h" | 38 #include "ui/base/resource/resource_bundle.h" |
| 39 #include "ui/base/webui/jstemplate_builder.h" | 39 #include "ui/base/webui/jstemplate_builder.h" |
| 40 #include "ui/base/webui/web_ui_util.h" | 40 #include "ui/base/webui/web_ui_util.h" |
| 41 | 41 |
| 42 #if BUILDFLAG(ANDROID_JAVA_UI) | 42 #if defined(OS_ANDROID) |
| 43 #include "chrome/browser/supervised_user/child_accounts/child_account_feedback_r eporter_android.h" | 43 #include "chrome/browser/supervised_user/child_accounts/child_account_feedback_r eporter_android.h" |
| 44 #elif !defined(OS_ANDROID) | 44 #elif !defined(OS_ANDROID) |
|
Ted C
2017/01/06 22:33:30
change to #else
F
2017/01/09 21:36:33
Done.
| |
| 45 #include "chrome/browser/ui/browser_finder.h" | 45 #include "chrome/browser/ui/browser_finder.h" |
| 46 #include "chrome/browser/ui/chrome_pages.h" | 46 #include "chrome/browser/ui/chrome_pages.h" |
| 47 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 47 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 48 #endif | 48 #endif |
| 49 | 49 |
| 50 using content::BrowserThread; | 50 using content::BrowserThread; |
| 51 using content::WebContents; | 51 using content::WebContents; |
| 52 | 52 |
| 53 namespace { | 53 namespace { |
| 54 | 54 |
| (...skipping 207 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 262 SupervisedUserServiceFactory::GetForProfile(profile_); | 262 SupervisedUserServiceFactory::GetForProfile(profile_); |
| 263 base::string16 second_custodian = | 263 base::string16 second_custodian = |
| 264 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); | 264 base::UTF8ToUTF16(supervised_user_service->GetSecondCustodianName()); |
| 265 | 265 |
| 266 if (command == "\"feedback\"") { | 266 if (command == "\"feedback\"") { |
| 267 base::string16 reason = | 267 base::string16 reason = |
| 268 l10n_util::GetStringUTF16(supervised_user_error_page::GetBlockMessageID( | 268 l10n_util::GetStringUTF16(supervised_user_error_page::GetBlockMessageID( |
| 269 reason_, true, second_custodian.empty())); | 269 reason_, true, second_custodian.empty())); |
| 270 std::string message = l10n_util::GetStringFUTF8( | 270 std::string message = l10n_util::GetStringFUTF8( |
| 271 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); | 271 IDS_BLOCK_INTERSTITIAL_DEFAULT_FEEDBACK_TEXT, reason); |
| 272 #if BUILDFLAG(ANDROID_JAVA_UI) | 272 #if defined(OS_ANDROID) |
| 273 ReportChildAccountFeedback(web_contents_, message, url_); | 273 ReportChildAccountFeedback(web_contents_, message, url_); |
| 274 #else | 274 #else |
| 275 chrome::ShowFeedbackPage(chrome::FindBrowserWithWebContents(web_contents_), | 275 chrome::ShowFeedbackPage(chrome::FindBrowserWithWebContents(web_contents_), |
| 276 message, std::string()); | 276 message, std::string()); |
| 277 #endif | 277 #endif |
| 278 return; | 278 return; |
| 279 } | 279 } |
| 280 | 280 |
| 281 NOTREACHED(); | 281 NOTREACHED(); |
| 282 } | 282 } |
| (...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 330 supervised_user_service->RemoveObserver(this); | 330 supervised_user_service->RemoveObserver(this); |
| 331 | 331 |
| 332 if (!callback_.is_null()) | 332 if (!callback_.is_null()) |
| 333 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, | 333 BrowserThread::PostTask(BrowserThread::IO, FROM_HERE, |
| 334 base::Bind(callback_, continue_request)); | 334 base::Bind(callback_, continue_request)); |
| 335 | 335 |
| 336 // After this, the WebContents may be destroyed. Make sure we don't try to use | 336 // After this, the WebContents may be destroyed. Make sure we don't try to use |
| 337 // it again. | 337 // it again. |
| 338 web_contents_ = NULL; | 338 web_contents_ = NULL; |
| 339 } | 339 } |
| OLD | NEW |