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

Side by Side Diff: ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions_bridge.h

Issue 2657673004: Add shutdown notification and service refs to SyncServiceObserver. (Closed)
Patch Set: Chromeos fix 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 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 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 IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_ 5 #ifndef IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_
6 #define IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_ 6 #define IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_
7 7
8 #import <UIKit/UIKit.h> 8 #import <UIKit/UIKit.h>
9 9
10 #import "base/ios/weak_nsobject.h" 10 #import "base/ios/weak_nsobject.h"
(...skipping 17 matching lines...) Expand all
28 28
29 // Bridge class that will notify the panel when the remote sessions content 29 // Bridge class that will notify the panel when the remote sessions content
30 // change. 30 // change.
31 class SyncedSessionsObserverBridge : public SyncObserverBridge, 31 class SyncedSessionsObserverBridge : public SyncObserverBridge,
32 public SigninManagerBase::Observer { 32 public SigninManagerBase::Observer {
33 public: 33 public:
34 SyncedSessionsObserverBridge(id<SyncedSessionsObserver> owner, 34 SyncedSessionsObserverBridge(id<SyncedSessionsObserver> owner,
35 ios::ChromeBrowserState* browserState); 35 ios::ChromeBrowserState* browserState);
36 ~SyncedSessionsObserverBridge() override; 36 ~SyncedSessionsObserverBridge() override;
37 // SyncObserverBridge implementation. 37 // SyncObserverBridge implementation.
38 void OnStateChanged() override; 38 void OnStateChanged(syncer::SyncService* sync) override;
39 void OnSyncCycleCompleted() override; 39 void OnSyncCycleCompleted(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 // SigninManagerBase::Observer implementation. 42 // SigninManagerBase::Observer implementation.
43 void GoogleSignedOut(const std::string& account_id, 43 void GoogleSignedOut(const std::string& account_id,
44 const std::string& username) override; 44 const std::string& username) override;
45 // Returns true if the first sync cycle that contains session information is 45 // Returns true if the first sync cycle that contains session information is
46 // completed. Returns false otherwise. 46 // completed. Returns false otherwise.
47 bool IsFirstSyncCycleCompleted(); 47 bool IsFirstSyncCycleCompleted();
48 48
49 private: 49 private:
50 base::WeakNSProtocol<id<SyncedSessionsObserver>> owner_; 50 base::WeakNSProtocol<id<SyncedSessionsObserver>> owner_;
51 SigninManager* signin_manager_; 51 SigninManager* signin_manager_;
52 syncer::SyncService* sync_service_; 52 syncer::SyncService* sync_service_;
53 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer> 53 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer>
54 signin_manager_observer_; 54 signin_manager_observer_;
55 // Stores whether the first sync cycle that contains session information is 55 // Stores whether the first sync cycle that contains session information is
56 // completed. 56 // completed.
57 bool first_sync_cycle_is_completed_; 57 bool first_sync_cycle_is_completed_;
58 }; 58 };
59 59
60 } // namespace synced_sessions 60 } // namespace synced_sessions
61 61
62 #endif // IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_ 62 #endif // IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_
OLDNEW
« no previous file with comments | « ios/chrome/browser/sync/sync_observer_bridge.mm ('k') | ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions_bridge.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698