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

Side by Side Diff: chrome/browser/media/router/issue_manager.h

Issue 2176613003: [Media Router] Clean up issues related code. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 CHROME_BROWSER_MEDIA_ROUTER_ISSUE_MANAGER_H_ 5 #ifndef CHROME_BROWSER_MEDIA_ROUTER_ISSUE_MANAGER_H_
6 #define CHROME_BROWSER_MEDIA_ROUTER_ISSUE_MANAGER_H_ 6 #define CHROME_BROWSER_MEDIA_ROUTER_ISSUE_MANAGER_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <vector> 10 #include <vector>
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 // Does not assume ownership of |observer|. 52 // Does not assume ownership of |observer|.
53 // |observer|: IssuesObserver to be registered. 53 // |observer|: IssuesObserver to be registered.
54 void RegisterObserver(IssuesObserver* observer); 54 void RegisterObserver(IssuesObserver* observer);
55 55
56 // Unregisters |observer| from |issues_observers_|. 56 // Unregisters |observer| from |issues_observers_|.
57 // |observer|: IssuesObserver to be unregistered. 57 // |observer|: IssuesObserver to be unregistered.
58 void UnregisterObserver(IssuesObserver* observer); 58 void UnregisterObserver(IssuesObserver* observer);
59 59
60 private: 60 private:
61 // Checks if the current top issue has changed. Updates |top_issue_|. 61 // Checks if the current top issue has changed. Updates |top_issue_|.
62 // If |top_issue_| has changed, issues in |issues_observers_| will be 62 // If |top_issue_| has changed, observers in |issues_observers_| will be
63 // notified of the new top issue. 63 // notified of the new top issue.
64 void MaybeUpdateTopIssue(); 64 void MaybeUpdateTopIssue();
65 65
66 std::vector<Issue> issues_; 66 std::vector<Issue> issues_;
67 67
68 // IssueObserver insteances are not owned by the manager. 68 // IssueObserver insteances are not owned by the manager.
69 base::ObserverList<IssuesObserver> issues_observers_; 69 base::ObserverList<IssuesObserver> issues_observers_;
70 70
71 // The ID of the current top issue. 71 // Pointer to the top Issue in |issues_|, or null if there are no Issues.
72 Issue::Id top_issue_id_; 72 const Issue* top_issue_;
mark a. foltz 2016/07/27 18:52:04 Consider base::Optional<Issue>.
imcheng 2016/09/13 20:27:54 Keeping this as a pointer so we don't have to copy
73 73
74 DISALLOW_COPY_AND_ASSIGN(IssueManager); 74 DISALLOW_COPY_AND_ASSIGN(IssueManager);
75 }; 75 };
76 76
77 } // namespace media_router 77 } // namespace media_router
78 78
79 #endif // CHROME_BROWSER_MEDIA_ROUTER_ISSUE_MANAGER_H_ 79 #endif // CHROME_BROWSER_MEDIA_ROUTER_ISSUE_MANAGER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698