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

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

Issue 1443683002: Notify DataUseTabModel of navigations and tab closures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: patch Created 5 years, 1 month 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_DATA_USE_TAB_MODEL_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_MODEL_H_
6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_MODEL_H_ 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_MODEL_H_
7 7
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
76 76
77 DataUseTabModel(const ExternalDataUseObserver* data_use_observer, 77 DataUseTabModel(const ExternalDataUseObserver* data_use_observer,
78 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner); 78 scoped_refptr<base::SingleThreadTaskRunner> ui_task_runner);
79 79
80 ~DataUseTabModel(); 80 ~DataUseTabModel();
81 81
82 base::WeakPtr<DataUseTabModel> GetWeakPtr(); 82 base::WeakPtr<DataUseTabModel> GetWeakPtr();
83 83
84 // Notifies the DataUseTabModel of navigation events. |tab_id| is the source 84 // Notifies the DataUseTabModel of navigation events. |tab_id| is the source
85 // tab of the generated event, |transition| indicates the type of the UI 85 // tab of the generated event, |transition| indicates the type of the UI
86 // event/transition, |url| is the URL in the source tab, |package| indicates 86 // event/transition, |url| is the URL in the source tab.
87 // the android package name of external application that initiated the event.
88 void OnNavigationEvent(int32_t tab_id, 87 void OnNavigationEvent(int32_t tab_id,
89 TransitionType transition, 88 TransitionType transition,
90 const GURL& url, 89 const GURL& url);
91 const std::string& package);
92 90
93 // Notifies the DataUseTabModel that tab with |tab_id| is closed. Any active 91 // Notifies the DataUseTabModel that tab with |tab_id| is closed. Any active
94 // tracking sessions for the tab are terminated, and the tab is marked as 92 // tracking sessions for the tab are terminated, and the tab is marked as
95 // closed. 93 // closed.
96 void OnTabCloseEvent(int32_t tab_id); 94 void OnTabCloseEvent(int32_t tab_id);
97 95
98 // Gets the label for the |data_use| object. |output_label| must not be null. 96 // Gets the label for the |data_use| object. |output_label| must not be null.
99 // If a tab tracking session is found that was active at the time of request 97 // If a tab tracking session is found that was active at the time of request
100 // start of |data_use|, returns true and |output_label| is populated with its 98 // start of |data_use|, returns true and |output_label| is populated with its
101 // label. Otherwise returns false and |output_label| is set to empty string. 99 // label. Otherwise returns false and |output_label| is set to empty string.
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
165 base::WeakPtrFactory<DataUseTabModel> weak_factory_; 163 base::WeakPtrFactory<DataUseTabModel> weak_factory_;
166 164
167 DISALLOW_COPY_AND_ASSIGN(DataUseTabModel); 165 DISALLOW_COPY_AND_ASSIGN(DataUseTabModel);
168 }; 166 };
169 167
170 } // namespace android 168 } // namespace android
171 169
172 } // namespace chrome 170 } // namespace chrome
173 171
174 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_MODEL_H_ 172 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_MODEL_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698