Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(789)

Side by Side Diff: chrome/browser/supervised_user/supervised_user_navigation_observer.cc

Issue 812823002: Remove dependency of infobars component on the embedder (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix compilation on Android Created 6 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 82 matching lines...) Expand 10 before | Expand all | Expand 10 after
93 int GetButtons() const override; 93 int GetButtons() const override;
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(
104 scoped_ptr<ConfirmInfoBarDelegate>( 104 infobar_service->CreateConfirmInfoBar(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
(...skipping 128 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698