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

Side by Side Diff: components/ntp_snippets/sessions/tab_delegate_sync_adapter.h

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Use parameter Created 3 years, 10 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 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 #ifndef COMPONENTS_NTP_SNIPPETS_SESSIONS_TAB_DELEGATE_SYNC_ADAPTER_H_ 5 #ifndef COMPONENTS_NTP_SNIPPETS_SESSIONS_TAB_DELEGATE_SYNC_ADAPTER_H_
6 #define COMPONENTS_NTP_SNIPPETS_SESSIONS_TAB_DELEGATE_SYNC_ADAPTER_H_ 6 #define COMPONENTS_NTP_SNIPPETS_SESSIONS_TAB_DELEGATE_SYNC_ADAPTER_H_
7 7
8 #include <vector> 8 #include <vector>
9 9
10 #include "base/callback.h" 10 #include "base/callback.h"
(...skipping 18 matching lines...) Expand all
29 29
30 // ForeignSessionsProvider implementation. 30 // ForeignSessionsProvider implementation.
31 bool HasSessionsData() override; 31 bool HasSessionsData() override;
32 std::vector<const sync_sessions::SyncedSession*> GetAllForeignSessions() 32 std::vector<const sync_sessions::SyncedSession*> GetAllForeignSessions()
33 override; 33 override;
34 void SubscribeForForeignTabChange( 34 void SubscribeForForeignTabChange(
35 const base::Closure& change_callback) override; 35 const base::Closure& change_callback) override;
36 36
37 private: 37 private:
38 // syncer::SyncServiceObserver implementation. 38 // syncer::SyncServiceObserver implementation.
39 void OnStateChanged() override; 39 void OnStateChanged(syncer::SyncService* sync) override;
40 void OnSyncConfigurationCompleted() override; 40 void OnSyncConfigurationCompleted(syncer::SyncService* sync) override;
41 void OnForeignSessionUpdated() override; 41 void OnForeignSessionUpdated(syncer::SyncService* sync) override;
42 42
43 void InvokeCallback(); 43 void InvokeCallback();
44 44
45 syncer::SyncService* sync_service_; 45 syncer::SyncService* sync_service_;
46 base::Closure change_callback_; 46 base::Closure change_callback_;
47 47
48 // Represents whether there was session data the last time |change_callback_| 48 // Represents whether there was session data the last time |change_callback_|
49 // was invoked. 49 // was invoked.
50 bool had_session_data_ = false; 50 bool had_session_data_ = false;
51 51
52 DISALLOW_COPY_AND_ASSIGN(TabDelegateSyncAdapter); 52 DISALLOW_COPY_AND_ASSIGN(TabDelegateSyncAdapter);
53 }; 53 };
54 54
55 } // namespace ntp_snippets 55 } // namespace ntp_snippets
56 56
57 #endif // COMPONENTS_NTP_SNIPPETS_SESSIONS_TAB_DELEGATE_SYNC_ADAPTER_H_ 57 #endif // COMPONENTS_NTP_SNIPPETS_SESSIONS_TAB_DELEGATE_SYNC_ADAPTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698