| 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 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 120 } | 120 } |
| 121 | 121 |
| 122 void SupervisedUserWarningInfoBarDelegate::InfoBarDismissed() { | 122 void SupervisedUserWarningInfoBarDelegate::InfoBarDismissed() { |
| 123 content::WebContents* web_contents = | 123 content::WebContents* web_contents = |
| 124 InfoBarService::WebContentsFromInfoBar(infobar()); | 124 InfoBarService::WebContentsFromInfoBar(infobar()); |
| 125 SupervisedUserNavigationObserver::FromWebContents( | 125 SupervisedUserNavigationObserver::FromWebContents( |
| 126 web_contents)->WarnInfoBarDismissed(); | 126 web_contents)->WarnInfoBarDismissed(); |
| 127 } | 127 } |
| 128 | 128 |
| 129 base::string16 SupervisedUserWarningInfoBarDelegate::GetMessageText() const { | 129 base::string16 SupervisedUserWarningInfoBarDelegate::GetMessageText() const { |
| 130 return l10n_util::GetStringUTF16(IDS_MANAGED_USER_WARN_INFOBAR_MESSAGE); | 130 return l10n_util::GetStringUTF16(IDS_SUPERVISED_USER_WARN_INFOBAR_MESSAGE); |
| 131 } | 131 } |
| 132 | 132 |
| 133 int SupervisedUserWarningInfoBarDelegate::GetButtons() const { | 133 int SupervisedUserWarningInfoBarDelegate::GetButtons() const { |
| 134 return BUTTON_OK; | 134 return BUTTON_OK; |
| 135 } | 135 } |
| 136 | 136 |
| 137 base::string16 SupervisedUserWarningInfoBarDelegate::GetButtonLabel( | 137 base::string16 SupervisedUserWarningInfoBarDelegate::GetButtonLabel( |
| 138 InfoBarButton button) const { | 138 InfoBarButton button) const { |
| 139 DCHECK_EQ(BUTTON_OK, button); | 139 DCHECK_EQ(BUTTON_OK, button); |
| 140 return l10n_util::GetStringUTF16(IDS_MANAGED_USER_WARN_INFOBAR_GO_BACK); | 140 return l10n_util::GetStringUTF16(IDS_SUPERVISED_USER_WARN_INFOBAR_GO_BACK); |
| 141 } | 141 } |
| 142 | 142 |
| 143 bool SupervisedUserWarningInfoBarDelegate::Accept() { | 143 bool SupervisedUserWarningInfoBarDelegate::Accept() { |
| 144 #if defined(OS_ANDROID) | 144 #if defined(OS_ANDROID) |
| 145 // TODO(bauerb): Get rid of the platform-specific #ifdef here. | 145 // TODO(bauerb): Get rid of the platform-specific #ifdef here. |
| 146 // http://crbug.com/313377 | 146 // http://crbug.com/313377 |
| 147 NOTIMPLEMENTED(); | 147 NOTIMPLEMENTED(); |
| 148 #else | 148 #else |
| 149 GoBackToSafety(InfoBarService::WebContentsFromInfoBar(infobar())); | 149 GoBackToSafety(InfoBarService::WebContentsFromInfoBar(infobar())); |
| 150 #endif | 150 #endif |
| (...skipping 105 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 256 history_service->AddPage(add_page_args); | 256 history_service->AddPage(add_page_args); |
| 257 | 257 |
| 258 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); | 258 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); |
| 259 entry->SetVirtualURL(url); | 259 entry->SetVirtualURL(url); |
| 260 entry->SetTimestamp(timestamp); | 260 entry->SetTimestamp(timestamp); |
| 261 blocked_navigations_.push_back(entry.release()); | 261 blocked_navigations_.push_back(entry.release()); |
| 262 SupervisedUserService* supervised_user_service = | 262 SupervisedUserService* supervised_user_service = |
| 263 SupervisedUserServiceFactory::GetForProfile(profile); | 263 SupervisedUserServiceFactory::GetForProfile(profile); |
| 264 supervised_user_service->DidBlockNavigation(web_contents()); | 264 supervised_user_service->DidBlockNavigation(web_contents()); |
| 265 } | 265 } |
| OLD | NEW |