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

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

Issue 1443683002: Notify DataUseTabModel of navigations and tab closures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed comments, Using two weak ptrs now. 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_HELPER_H_ 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_HELPER_H_
6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_HELPER_H_ 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_HELPER_H_
7 7
8 #include "base/macros.h" 8 #include "base/macros.h"
9 #include "content/public/browser/web_contents_observer.h" 9 #include "content/public/browser/web_contents_observer.h"
10 #include "content/public/browser/web_contents_user_data.h" 10 #include "content/public/browser/web_contents_user_data.h"
11 11
12 namespace content { 12 namespace content {
13 class RenderFrameHost; 13 class RenderFrameHost;
14 class NavigationHandle; 14 class NavigationHandle;
15 } 15 }
16 16
17 // Per-tab class to manage tab closures and navigations, so that data usage per 17 // Per-tab class to manage tab closures and navigations, so that data usage per
18 // tab can be properly recorded.. 18 // tab can be properly recorded..
19 class DataUseTabHelper : public content::WebContentsObserver, 19 class DataUseTabHelper : public content::WebContentsObserver,
20 public content::WebContentsUserData<DataUseTabHelper> { 20 public content::WebContentsUserData<DataUseTabHelper> {
21 public: 21 public:
22 ~DataUseTabHelper() override; 22 ~DataUseTabHelper() override;
23 23
24 private: 24 private:
25 friend class content::WebContentsUserData<DataUseTabHelper>; 25 friend class content::WebContentsUserData<DataUseTabHelper>;
26 26
27 explicit DataUseTabHelper(content::WebContents* web_contents); 27 explicit DataUseTabHelper(content::WebContents* web_contents);
28 28
29 // Overridden from content::WebContentsObserver: 29 // Overridden from content::WebContentsObserver:
30 void ReadyToCommitNavigation( 30 void DidFinishNavigation(
31 content::NavigationHandle* navigation_handle) override; 31 content::NavigationHandle* navigation_handle) override;
32 void FrameDeleted(content::RenderFrameHost* render_frame_host) override; 32 void RenderFrameDeleted(content::RenderFrameHost* render_frame_host) override;
33 33
34 DISALLOW_COPY_AND_ASSIGN(DataUseTabHelper); 34 DISALLOW_COPY_AND_ASSIGN(DataUseTabHelper);
35 }; 35 };
36 36
37 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_HELPER_H_ 37 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_DATA_USE_TAB_HELPER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698