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

Side by Side Diff: components/ntp_snippets/remote/scheduling_remote_suggestions_provider.cc

Issue 2599743002: Trigger the Snippets Scheduler when Resuming Activities (Closed)
Patch Set: Renamed and moved the call to the bridge. Created 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 "components/ntp_snippets/remote/scheduling_remote_suggestions_provider. h" 5 #include "components/ntp_snippets/remote/scheduling_remote_suggestions_provider. h"
6 6
7 #include <string> 7 #include <string>
8 #include <utility> 8 #include <utility>
9 9
10 #include "components/ntp_snippets/features.h" 10 #include "components/ntp_snippets/features.h"
(...skipping 120 matching lines...) Expand 10 before | Expand all | Expand 10 after
131 } 131 }
132 132
133 void SchedulingRemoteSuggestionsProvider::OnPersistentSchedulerWakeUp() { 133 void SchedulingRemoteSuggestionsProvider::OnPersistentSchedulerWakeUp() {
134 provider_->RefetchInTheBackground( 134 provider_->RefetchInTheBackground(
135 base::MakeUnique<RemoteSuggestionsProvider::FetchStatusCallback>( 135 base::MakeUnique<RemoteSuggestionsProvider::FetchStatusCallback>(
136 base::Bind(&SchedulingRemoteSuggestionsProvider::OnFetchCompleted, 136 base::Bind(&SchedulingRemoteSuggestionsProvider::OnFetchCompleted,
137 base::Unretained(this)))); 137 base::Unretained(this))));
138 } 138 }
139 139
140 void SchedulingRemoteSuggestionsProvider::OnBrowserStartup() { 140 void SchedulingRemoteSuggestionsProvider::OnBrowserStartup() {
141 // TODO(fhorschig): Consider that this is called twice for split screens.
Michael van Ouwerkerk 2016/12/23 11:04:42 Not just twice, any number of times if the user sp
fhorschig 2017/01/03 15:04:26 Adjusted comment to the resuming functionality.
141 // TODO(jkrcal): Implement. 142 // TODO(jkrcal): Implement.
142 } 143 }
143 144
144 void SchedulingRemoteSuggestionsProvider::OnNTPOpened() { 145 void SchedulingRemoteSuggestionsProvider::OnNTPOpened() {
145 // TODO(jkrcal): Implement. 146 // TODO(jkrcal): Implement.
146 } 147 }
147 148
148 void SchedulingRemoteSuggestionsProvider::SetProviderStatusCallback( 149 void SchedulingRemoteSuggestionsProvider::SetProviderStatusCallback(
149 std::unique_ptr<ProviderStatusCallback> callback) { 150 std::unique_ptr<ProviderStatusCallback> callback) {
150 provider_->SetProviderStatusCallback(std::move(callback)); 151 provider_->SetProviderStatusCallback(std::move(callback));
(...skipping 177 matching lines...) Expand 10 before | Expand all | Expand 10 after
328 } 329 }
329 330
330 // Reschedule after a successful fetch. This resets all currently scheduled 331 // Reschedule after a successful fetch. This resets all currently scheduled
331 // fetches, to make sure the fallback interval triggers only if no wifi fetch 332 // fetches, to make sure the fallback interval triggers only if no wifi fetch
332 // succeeded, and also that we don't do a background fetch immediately after 333 // succeeded, and also that we don't do a background fetch immediately after
333 // a user-initiated one. 334 // a user-initiated one.
334 ApplyFetchingSchedule(GetLastFetchingSchedule()); 335 ApplyFetchingSchedule(GetLastFetchingSchedule());
335 } 336 }
336 337
337 } // namespace ntp_snippets 338 } // namespace ntp_snippets
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698