| 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/i18n/rtl.h" | 7 #include "base/i18n/rtl.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/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
| 11 #include "base/values.h" | 11 #include "base/values.h" |
| 12 #include "chrome/browser/infobars/infobar_service.h" | 12 #include "chrome/browser/infobars/infobar_service.h" |
| 13 #include "chrome/browser/profiles/profile.h" | 13 #include "chrome/browser/profiles/profile.h" |
| 14 #include "chrome/browser/supervised_user/supervised_user_service.h" | 14 #include "chrome/browser/supervised_user/supervised_user_service.h" |
| 15 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" | 15 #include "chrome/browser/supervised_user/supervised_user_service_factory.h" |
| 16 #include "chrome/common/pref_names.h" | 16 #include "chrome/common/pref_names.h" |
| 17 #include "chrome/grit/generated_resources.h" |
| 17 #include "components/infobars/core/infobar.h" | 18 #include "components/infobars/core/infobar.h" |
| 18 #include "components/infobars/core/infobar_delegate.h" | 19 #include "components/infobars/core/infobar_delegate.h" |
| 19 #include "content/public/browser/browser_thread.h" | 20 #include "content/public/browser/browser_thread.h" |
| 20 #include "content/public/browser/interstitial_page.h" | 21 #include "content/public/browser/interstitial_page.h" |
| 21 #include "content/public/browser/navigation_controller.h" | 22 #include "content/public/browser/navigation_controller.h" |
| 22 #include "content/public/browser/navigation_details.h" | 23 #include "content/public/browser/navigation_details.h" |
| 23 #include "content/public/browser/navigation_entry.h" | 24 #include "content/public/browser/navigation_entry.h" |
| 24 #include "content/public/browser/web_contents.h" | 25 #include "content/public/browser/web_contents.h" |
| 25 #include "content/public/browser/web_ui.h" | 26 #include "content/public/browser/web_ui.h" |
| 26 #include "grit/browser_resources.h" | 27 #include "grit/browser_resources.h" |
| 27 #include "grit/generated_resources.h" | |
| 28 #include "net/base/net_util.h" | 28 #include "net/base/net_util.h" |
| 29 #include "ui/base/l10n/l10n_util.h" | 29 #include "ui/base/l10n/l10n_util.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
| 31 #include "ui/base/webui/jstemplate_builder.h" | 31 #include "ui/base/webui/jstemplate_builder.h" |
| 32 #include "ui/base/webui/web_ui_util.h" | 32 #include "ui/base/webui/web_ui_util.h" |
| 33 | 33 |
| 34 using content::BrowserThread; | 34 using content::BrowserThread; |
| 35 | 35 |
| 36 // static | 36 // static |
| 37 void SupervisedUserInterstitial::Show(content::WebContents* web_contents, | 37 void SupervisedUserInterstitial::Show(content::WebContents* web_contents, |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 void SupervisedUserInterstitial::DispatchContinueRequest( | 227 void SupervisedUserInterstitial::DispatchContinueRequest( |
| 228 bool continue_request) { | 228 bool continue_request) { |
| 229 // If there is no history entry to go back to, close the tab instead. | 229 // If there is no history entry to go back to, close the tab instead. |
| 230 int nav_entry_count = web_contents_->GetController().GetEntryCount(); | 230 int nav_entry_count = web_contents_->GetController().GetEntryCount(); |
| 231 if (!continue_request && nav_entry_count == 0) | 231 if (!continue_request && nav_entry_count == 0) |
| 232 web_contents_->Close(); | 232 web_contents_->Close(); |
| 233 | 233 |
| 234 BrowserThread::PostTask( | 234 BrowserThread::PostTask( |
| 235 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); | 235 BrowserThread::IO, FROM_HERE, base::Bind(callback_, continue_request)); |
| 236 } | 236 } |
| OLD | NEW |