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

Side by Side Diff: components/sync_sessions/revisit/page_revisit_broadcaster.h

Issue 2343463003: [Sync] Fix namespaces for the sync_sessions component. (Closed)
Patch Set: Fix Android. Created 4 years, 3 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 COMPONENTS_SYNC_SESSIONS_REVISIT_PAGE_REVISIT_BROADCASTER_H_ 5 #ifndef COMPONENTS_SYNC_SESSIONS_REVISIT_PAGE_REVISIT_BROADCASTER_H_
6 #define COMPONENTS_SYNC_SESSIONS_REVISIT_PAGE_REVISIT_BROADCASTER_H_ 6 #define COMPONENTS_SYNC_SESSIONS_REVISIT_PAGE_REVISIT_BROADCASTER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "base/memory/scoped_vector.h" 9 #include "base/memory/scoped_vector.h"
10 #include "components/sync_sessions/revisit/page_visit_observer.h" 10 #include "components/sync_sessions/revisit/page_visit_observer.h"
11 #include "ui/base/page_transition_types.h" 11 #include "ui/base/page_transition_types.h"
12 #include "url/gurl.h" 12 #include "url/gurl.h"
13 13
14 namespace sync_sessions { 14 namespace sync_sessions {
15 class SyncSessionsClient; 15 class SyncSessionsClient;
16 } 16 }
17 17
18 namespace browser_sync { 18 namespace sync_sessions {
19 19
20 class SessionsSyncManager; 20 class SessionsSyncManager;
21 21
22 // This class has the job of creating and holding onto the PageVisitObservers 22 // This class has the job of creating and holding onto the PageVisitObservers
23 // that are to be notified on page change for purposes of instrumenting 23 // that are to be notified on page change for purposes of instrumenting
24 // revisists. 24 // revisists.
25 class PageRevisitBroadcaster { 25 class PageRevisitBroadcaster {
26 public: 26 public:
27 PageRevisitBroadcaster(SessionsSyncManager* manager, 27 PageRevisitBroadcaster(SessionsSyncManager* manager,
28 sync_sessions::SyncSessionsClient* sessions_client); 28 SyncSessionsClient* sessions_client);
29 ~PageRevisitBroadcaster(); 29 ~PageRevisitBroadcaster();
30 30
31 // Broadcasts to all observers the given page visit event. Should only be 31 // Broadcasts to all observers the given page visit event. Should only be
32 // called when the url changes. 32 // called when the url changes.
33 void OnPageVisit(const GURL& url, const ui::PageTransition transition); 33 void OnPageVisit(const GURL& url, const ui::PageTransition transition);
34 34
35 private: 35 private:
36 friend class SyncPageRevisitBroadcasterTest; 36 friend class SyncPageRevisitBroadcasterTest;
37 37
38 // We convert between enums here for a couple reasons. We don't want to force 38 // We convert between enums here for a couple reasons. We don't want to force
39 // observers to depend on ui/, and the high bit masks don't work for emitting 39 // observers to depend on ui/, and the high bit masks don't work for emitting
40 // histograms. Some of the high bit masks correspond to cases we're 40 // histograms. Some of the high bit masks correspond to cases we're
41 // particularly interested in and want to treat as first class values. 41 // particularly interested in and want to treat as first class values.
42 static sync_sessions::PageVisitObserver::TransitionType ConvertTransitionEnum( 42 static PageVisitObserver::TransitionType ConvertTransitionEnum(
43 const ui::PageTransition original); 43 const ui::PageTransition original);
44 44
45 // The client of this sync sessions datatype. 45 // The client of this sync sessions datatype.
46 sync_sessions::SyncSessionsClient* const sessions_client_; 46 SyncSessionsClient* const sessions_client_;
47 47
48 ScopedVector<sync_sessions::PageVisitObserver> revisit_observers_; 48 ScopedVector<PageVisitObserver> revisit_observers_;
49 49
50 DISALLOW_COPY_AND_ASSIGN(PageRevisitBroadcaster); 50 DISALLOW_COPY_AND_ASSIGN(PageRevisitBroadcaster);
51 }; 51 };
52 52
53 } // namespace browser_sync 53 } // namespace sync_sessions
54 54
55 #endif // COMPONENTS_SYNC_SESSIONS_REVISIT_PAGE_REVISIT_BROADCASTER_H_ 55 #endif // COMPONENTS_SYNC_SESSIONS_REVISIT_PAGE_REVISIT_BROADCASTER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698