Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 Loading... | |
| 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 transition |page_transition| for page url |gurl| to |
|
tbansal1
2016/03/17 23:16:53
s/Converts transition |page_transition| for page u
Raj
2016/03/18 00:45:49
Done.
| |
| 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_ |
| OLD | NEW |