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

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

Issue 1811173002: DataUseTabModel should check the URL to differentiate history navigation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed tbansal comments Created 4 years, 9 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
« no previous file with comments | « no previous file | chrome/browser/android/data_usage/data_use_ui_tab_model.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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_DATA_USE_UI_TAB_MODEL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_UI_TAB_MODEL_H_
6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_UI_TAB_MODEL_H_ 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_UI_TAB_MODEL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 106 matching lines...) Expand 10 before | Expand all | Expand 10 after
117 // Creates |event| for tab with id |tab_id| and value |event|, if there is no 117 // Creates |event| for tab with id |tab_id| and value |event|, if there is no
118 // existing entry for |tab_id|, and returns true. Otherwise, returns false 118 // existing entry for |tab_id|, and returns true. Otherwise, returns false
119 // without modifying the entry. 119 // without modifying the entry.
120 bool MaybeCreateTabEvent(SessionID::id_type tab_id, 120 bool MaybeCreateTabEvent(SessionID::id_type tab_id,
121 DataUseTrackingEvent event); 121 DataUseTrackingEvent event);
122 122
123 // Removes event entry for |tab_id|, if the entry is equal to |event|, and 123 // Removes event entry for |tab_id|, if the entry is equal to |event|, and
124 // returns true. Otherwise, returns false without modifying the entry. 124 // returns true. Otherwise, returns false without modifying the entry.
125 bool RemoveTabEvent(SessionID::id_type tab_id, DataUseTrackingEvent event); 125 bool RemoveTabEvent(SessionID::id_type tab_id, DataUseTrackingEvent event);
126 126
127 // Converts |page_transition| to DataUseTabModel::TransitionType enum. 127 // Converts |page_transition| to page with GURL |gurl| to
128 // Returns true if conversion was successful, and updates |transition_type|. 128 // DataUseTabModel::TransitionType enum. Returns true if conversion was
129 // Otherwise, returns false, and |transition_type| is not changed. 129 // successful, and updates |transition_type|. Otherwise, returns false, and
130 // |transition_type| must not be null. 130 // |transition_type| is not changed. |transition_type| must not be null.
131 bool ConvertTransitionType( 131 bool ConvertTransitionType(
132 ui::PageTransition page_transition, 132 ui::PageTransition page_transition,
133 const GURL& gurl,
133 DataUseTabModel::TransitionType* transition_type) const; 134 DataUseTabModel::TransitionType* transition_type) const;
134 135
135 // |tab_events_| stores tracking events of multiple tabs. 136 // |tab_events_| stores tracking events of multiple tabs.
136 TabEvents tab_events_; 137 TabEvents tab_events_;
137 138
138 // |data_use_tab_model_| is notified by |this| about browser navigations 139 // |data_use_tab_model_| is notified by |this| about browser navigations
139 // and tab closures on UI thread. 140 // and tab closures on UI thread.
140 base::WeakPtr<DataUseTabModel> data_use_tab_model_; 141 base::WeakPtr<DataUseTabModel> data_use_tab_model_;
141 142
142 base::ThreadChecker thread_checker_; 143 base::ThreadChecker thread_checker_;
143 144
144 base::WeakPtrFactory<DataUseUITabModel> weak_factory_; 145 base::WeakPtrFactory<DataUseUITabModel> weak_factory_;
145 146
146 DISALLOW_COPY_AND_ASSIGN(DataUseUITabModel); 147 DISALLOW_COPY_AND_ASSIGN(DataUseUITabModel);
147 }; 148 };
148 149
149 } // namespace android 150 } // namespace android
150 151
151 } // namespace chrome 152 } // namespace chrome
152 153
153 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_UI_TAB_MODEL_H_ 154 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_UI_TAB_MODEL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/android/data_usage/data_use_ui_tab_model.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698