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

Side by Side Diff: chrome/browser/android/data_usage/external_data_use_observer.h

Issue 1443683002: Notify DataUseTabModel of navigations and tab closures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased Created 5 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
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_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_ 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
7 7
8 #include <jni.h> 8 #include <jni.h>
9 #include <stdint.h> 9 #include <stdint.h>
10 10
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // |label| must not be null. If a match is found, the |label| is set to the 89 // |label| must not be null. If a match is found, the |label| is set to the
90 // matching rule's label. 90 // matching rule's label.
91 bool Matches(const GURL& gurl, std::string* label) const; 91 bool Matches(const GURL& gurl, std::string* label) const;
92 92
93 // Returns true if the |app_package_name| matches the registered package 93 // Returns true if the |app_package_name| matches the registered package
94 // names. |label| must not be null. If a match is found, the |label| is set 94 // names. |label| must not be null. If a match is found, the |label| is set
95 // to the matching rule's label. 95 // to the matching rule's label.
96 bool MatchesAppPackageName(const std::string& app_package_name, 96 bool MatchesAppPackageName(const std::string& app_package_name,
97 std::string* label) const; 97 std::string* label) const;
98 98
99 DataUseTabModel* data_use_tab_model() const { 99 DataUseTabModel* GetDataUseTabModel() const;
100 return data_use_tab_model_.get();
101 }
102 100
103 private: 101 private:
104 friend class DataUseTabModelTest; 102 friend class DataUseTabModelTest;
105 friend class ExternalDataUseObserverTest; 103 friend class ExternalDataUseObserverTest;
106 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, SingleRegex); 104 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
107 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, TwoRegex); 105 AtMostOneDataUseSubmitRequest);
sclittle 2015/11/30 22:33:38 nit: I don't think this test exists anymore
tbansal1 2015/11/30 22:59:09 Done.
108 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, MultipleRegex); 106 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, BufferDataUseReports);
107 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, BufferSize);
109 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, ChangeRegex); 108 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, ChangeRegex);
109 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, HashFunction);
110 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, LabelRemoved); 110 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, LabelRemoved);
111 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, MultipleMatchingRules); 111 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, MultipleMatchingRules);
112 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, MultipleRegex);
113 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
114 PeriodicFetchMatchingRules);
112 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, ReportsMergedCorrectly); 115 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, ReportsMergedCorrectly);
116 FRIEND_TEST_ALL_PREFIXES(DataUseUITabModelTest, ReportTabEventsTest);
sclittle 2015/11/30 22:33:38 nit: This should alphabetically come before the Ex
tbansal1 2015/11/30 22:59:09 Done.
117 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, SingleRegex);
113 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, 118 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
114 TimestampsMergedCorrectly); 119 TimestampsMergedCorrectly);
115 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, HashFunction); 120 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, TwoRegex);
116 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, BufferSize);
117 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest,
118 PeriodicFetchMatchingRules);
119 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, BufferDataUseReports);
120 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, Variations); 121 FRIEND_TEST_ALL_PREFIXES(ExternalDataUseObserverTest, Variations);
121 122
122 // DataUseReportKey is a unique identifier for a data use report. 123 // DataUseReportKey is a unique identifier for a data use report.
123 struct DataUseReportKey { 124 struct DataUseReportKey {
124 DataUseReportKey(const std::string& label, 125 DataUseReportKey(const std::string& label,
125 net::NetworkChangeNotifier::ConnectionType connection_type, 126 net::NetworkChangeNotifier::ConnectionType connection_type,
126 const std::string& mcc_mnc); 127 const std::string& mcc_mnc);
127 128
128 bool operator==(const DataUseReportKey& other) const; 129 bool operator==(const DataUseReportKey& other) const;
129 130
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
326 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserver); 327 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserver);
327 }; 328 };
328 329
329 bool RegisterExternalDataUseObserver(JNIEnv* env); 330 bool RegisterExternalDataUseObserver(JNIEnv* env);
330 331
331 } // namespace android 332 } // namespace android
332 333
333 } // namespace chrome 334 } // namespace chrome
334 335
335 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_ 336 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698