| 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_navigation_observer.h" | 5 #include "chrome/browser/supervised_user/supervised_user_navigation_observer.h" |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/callback.h" | 8 #include "base/callback.h" |
| 9 #include "base/metrics/histogram.h" | 9 #include "base/metrics/histogram.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 94 base::string16 GetButtonLabel(InfoBarButton button) const override; | 94 base::string16 GetButtonLabel(InfoBarButton button) const override; |
| 95 bool Accept() override; | 95 bool Accept() override; |
| 96 | 96 |
| 97 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWarningInfoBarDelegate); | 97 DISALLOW_COPY_AND_ASSIGN(SupervisedUserWarningInfoBarDelegate); |
| 98 }; | 98 }; |
| 99 | 99 |
| 100 // static | 100 // static |
| 101 infobars::InfoBar* SupervisedUserWarningInfoBarDelegate::Create( | 101 infobars::InfoBar* SupervisedUserWarningInfoBarDelegate::Create( |
| 102 InfoBarService* infobar_service) { | 102 InfoBarService* infobar_service) { |
| 103 return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( | 103 return infobar_service->AddInfoBar(ConfirmInfoBarDelegate::CreateInfoBar( |
| 104 scoped_ptr<ConfirmInfoBarDelegate>( | 104 infobar_service, scoped_ptr<ConfirmInfoBarDelegate>( |
| 105 new SupervisedUserWarningInfoBarDelegate()))); | 105 new SupervisedUserWarningInfoBarDelegate()))); |
| 106 } | 106 } |
| 107 | 107 |
| 108 SupervisedUserWarningInfoBarDelegate::SupervisedUserWarningInfoBarDelegate() | 108 SupervisedUserWarningInfoBarDelegate::SupervisedUserWarningInfoBarDelegate() |
| 109 : ConfirmInfoBarDelegate() { | 109 : ConfirmInfoBarDelegate() { |
| 110 } | 110 } |
| 111 | 111 |
| 112 SupervisedUserWarningInfoBarDelegate::~SupervisedUserWarningInfoBarDelegate() { | 112 SupervisedUserWarningInfoBarDelegate::~SupervisedUserWarningInfoBarDelegate() { |
| 113 } | 113 } |
| 114 | 114 |
| 115 bool SupervisedUserWarningInfoBarDelegate::ShouldExpire( | 115 bool SupervisedUserWarningInfoBarDelegate::ShouldExpire( |
| (...skipping 127 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 243 history_service->AddPage(add_page_args); | 243 history_service->AddPage(add_page_args); |
| 244 | 244 |
| 245 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); | 245 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); |
| 246 entry->SetVirtualURL(url); | 246 entry->SetVirtualURL(url); |
| 247 entry->SetTimestamp(timestamp); | 247 entry->SetTimestamp(timestamp); |
| 248 blocked_navigations_.push_back(entry.release()); | 248 blocked_navigations_.push_back(entry.release()); |
| 249 SupervisedUserService* supervised_user_service = | 249 SupervisedUserService* supervised_user_service = |
| 250 SupervisedUserServiceFactory::GetForProfile(profile); | 250 SupervisedUserServiceFactory::GetForProfile(profile); |
| 251 supervised_user_service->DidBlockNavigation(web_contents()); | 251 supervised_user_service->DidBlockNavigation(web_contents()); |
| 252 } | 252 } |
| OLD | NEW |