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

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

Issue 2589803002: Upstream Chrome on iOS source code [6/11]. (Closed)
Patch Set: 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
(Empty)
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
3 // found in the LICENSE file.
4
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_
7
8 #import <UIKit/UIKit.h>
9
10 #import "base/ios/weak_nsobject.h"
11 #include "components/signin/core/browser/signin_manager_base.h"
12 #include "components/sync/driver/sync_service_observer.h"
13 #import "ios/chrome/browser/sync/sync_observer_bridge.h"
14 #import "ios/chrome/browser/ui/ntp/recent_tabs/synced_sessions_bridge.h"
15
16 namespace ios {
17 class ChromeBrowserState;
18 }
19 class SigninManager;
20
21 @class RecentTabsPanelController;
22
23 @protocol SyncedSessionsObserver<SyncObserverModelBridge>
24 - (void)reloadSessions;
25 @end
26
27 namespace synced_sessions {
28
29 // Bridge class that will notify the panel when the remote sessions content
30 // change.
31 class SyncedSessionsObserverBridge : public SyncObserverBridge,
32 public SigninManagerBase::Observer {
33 public:
34 SyncedSessionsObserverBridge(id<SyncedSessionsObserver> owner,
35 ios::ChromeBrowserState* browserState);
36 ~SyncedSessionsObserverBridge() override;
37 // SyncObserverBridge implementation.
38 void OnStateChanged() override;
39 void OnSyncCycleCompleted() override;
40 void OnSyncConfigurationCompleted() override;
41 void OnForeignSessionUpdated() override;
42 // SigninManagerBase::Observer implementation.
43 void GoogleSignedOut(const std::string& account_id,
44 const std::string& username) override;
45 // Returns true if the first sync cycle that contains session information is
46 // completed. Returns false otherwise.
47 bool IsFirstSyncCycleCompleted();
48
49 private:
50 base::WeakNSProtocol<id<SyncedSessionsObserver>> owner_;
51 SigninManager* signin_manager_;
52 syncer::SyncService* sync_service_;
53 ScopedObserver<SigninManagerBase, SigninManagerBase::Observer>
54 signin_manager_observer_;
55 // Stores whether the first sync cycle that contains session information is
56 // completed.
57 bool first_sync_cycle_is_completed_;
58 };
59
60 } // namespace synced_sessions
61
62 #endif // IOS_CHROME_BROWSER_UI_NTP_RECENT_TABS_SYNCED_SESSIONS_BRIDGE_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698