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

Unified Diff: chrome/browser/profiles/profile_impl_io_data.cc

Issue 1443683002: Notify DataUseTabModel of navigations and tab closures (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed sclittle comments 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 side-by-side diff with in-line comments
Download patch
« chrome/browser/io_thread.h ('K') | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/profiles/profile_impl_io_data.cc
diff --git a/chrome/browser/profiles/profile_impl_io_data.cc b/chrome/browser/profiles/profile_impl_io_data.cc
index 6f1c2a1dda2e2d9737260e8573e110986240c3c2..b2b1aad6ef6194eeea5f20737bec27677a52fdc8 100644
--- a/chrome/browser/profiles/profile_impl_io_data.cc
+++ b/chrome/browser/profiles/profile_impl_io_data.cc
@@ -65,6 +65,13 @@
#include "net/url_request/url_request_job_factory_impl.h"
#include "storage/browser/quota/special_storage_policy.h"
+#if defined(OS_ANDROID)
+#include "chrome/browser/android/data_usage/data_use_tab_model.h"
+#include "chrome/browser/android/data_usage/data_use_ui_tab_model.h"
+#include "chrome/browser/android/data_usage/data_use_ui_tab_model_factory.h"
+#include "chrome/browser/android/data_usage/external_data_use_observer.h"
sclittle 2015/11/24 23:07:37 nit: unnecessary include
tbansal1 2015/11/25 20:55:16 Obsolete.
+#endif // defined(OS_ANDROID)
+
namespace {
net::BackendType ChooseCacheBackendType() {
@@ -199,6 +206,15 @@ void ProfileImplIOData::Handle::Init(
profile_->GetRequestContext(), store.Pass(),
BrowserThread::GetMessageLoopProxyForThread(BrowserThread::UI),
db_task_runner);
+
+#if defined(OS_ANDROID)
+ // Pass the DataUseTabModel weak pointer to DataUseUITabModel.
+ chrome::android::DataUseUITabModel* data_use_ui_tab_model =
+ chrome::android::DataUseUITabModelFactory::GetForBrowserContext(profile_);
+ if (data_use_ui_tab_model && !io_data_->IsOffTheRecord())
+ data_use_ui_tab_model->SetDataUseTabModel(
+ g_browser_process->io_thread()->data_use_tab_model());
sclittle 2015/11/24 23:07:37 This is only safe if you can be certain that io_th
tbansal1 2015/11/25 20:55:16 Obsolete.
+#endif // defined(OS_ANDROID)
}
content::ResourceContext*
« chrome/browser/io_thread.h ('K') | « chrome/browser/io_thread.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698