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

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

Issue 1878143002: Convert //chrome/browser/supervised_user from scoped_ptr to std::unique_ptr (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 8 months 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 "chrome/browser/history/history_service_factory.h" 9 #include "chrome/browser/history/history_service_factory.h"
10 #include "chrome/browser/profiles/profile.h" 10 #include "chrome/browser/profiles/profile.h"
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
74 Profile* profile = 74 Profile* profile =
75 Profile::FromBrowserContext(web_contents_->GetBrowserContext()); 75 Profile::FromBrowserContext(web_contents_->GetBrowserContext());
76 history::HistoryService* history_service = 76 history::HistoryService* history_service =
77 HistoryServiceFactory::GetForProfile(profile, 77 HistoryServiceFactory::GetForProfile(profile,
78 ServiceAccessType::IMPLICIT_ACCESS); 78 ServiceAccessType::IMPLICIT_ACCESS);
79 79
80 // |history_service| is null if saving history is disabled. 80 // |history_service| is null if saving history is disabled.
81 if (history_service) 81 if (history_service)
82 history_service->AddPage(add_page_args); 82 history_service->AddPage(add_page_args);
83 83
84 scoped_ptr<NavigationEntry> entry(NavigationEntry::Create()); 84 std::unique_ptr<NavigationEntry> entry(NavigationEntry::Create());
85 entry->SetVirtualURL(url); 85 entry->SetVirtualURL(url);
86 entry->SetTimestamp(timestamp); 86 entry->SetTimestamp(timestamp);
87 scoped_ptr<sessions::SerializedNavigationEntry> serialized_entry( 87 std::unique_ptr<sessions::SerializedNavigationEntry> serialized_entry(
88 new sessions::SerializedNavigationEntry()); 88 new sessions::SerializedNavigationEntry());
89 *serialized_entry = 89 *serialized_entry =
90 sessions::ContentSerializedNavigationBuilder::FromNavigationEntry( 90 sessions::ContentSerializedNavigationBuilder::FromNavigationEntry(
91 blocked_navigations_.size(), *entry); 91 blocked_navigations_.size(), *entry);
92 blocked_navigations_.push_back(serialized_entry.release()); 92 blocked_navigations_.push_back(serialized_entry.release());
93 supervised_user_service_->DidBlockNavigation(web_contents_); 93 supervised_user_service_->DidBlockNavigation(web_contents_);
94 } 94 }
95 95
96 void SupervisedUserNavigationObserver::OnURLFilterChanged() { 96 void SupervisedUserNavigationObserver::OnURLFilterChanged() {
97 url_filter_->GetFilteringBehaviorForURLWithAsyncChecks( 97 url_filter_->GetFilteringBehaviorForURLWithAsyncChecks(
(...skipping 10 matching lines...) Expand all
108 bool uncertain) { 108 bool uncertain) {
109 // If the page has been changed in the meantime, we can exit. 109 // If the page has been changed in the meantime, we can exit.
110 if (url != web_contents_->GetLastCommittedURL()) 110 if (url != web_contents_->GetLastCommittedURL())
111 return; 111 return;
112 112
113 if (behavior == SupervisedUserURLFilter::FilteringBehavior::BLOCK) { 113 if (behavior == SupervisedUserURLFilter::FilteringBehavior::BLOCK) {
114 SupervisedUserInterstitial::Show(web_contents_, url, reason, 114 SupervisedUserInterstitial::Show(web_contents_, url, reason,
115 base::Callback<void(bool)>()); 115 base::Callback<void(bool)>());
116 } 116 }
117 } 117 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698