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

Unified Diff: chrome/browser/android/data_usage/data_use_tab_model.cc

Issue 1774973004: Fetching the matching rules when control app is installed (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/android/data_usage/external_data_use_observer_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/android/data_usage/data_use_tab_model.cc
diff --git a/chrome/browser/android/data_usage/data_use_tab_model.cc b/chrome/browser/android/data_usage/data_use_tab_model.cc
index 77b6257c9f274d2455203d5c2269c6bd7b248b0b..3920c647e191e6b232ee07d82dd2956782e58c20 100644
--- a/chrome/browser/android/data_usage/data_use_tab_model.cc
+++ b/chrome/browser/android/data_usage/data_use_tab_model.cc
@@ -265,12 +265,16 @@ void DataUseTabModel::OnControlAppInstallStateChange(
bool is_control_app_installed) {
DCHECK(thread_checker_.CalledOnValidThread());
DCHECK_NE(is_control_app_installed_, is_control_app_installed);
- // If external control app is installed now, rules will be fetched on the next
- // navigation event.
+
is_control_app_installed_ = is_control_app_installed;
std::vector<std::string> empty;
- if (!is_control_app_installed_) // Clear rules.
+ if (!is_control_app_installed_) {
+ // Clear rules.
data_use_matcher_->RegisterURLRegexes(empty, empty, empty);
+ } else {
+ // Fetch the matching rules when the app is installed.
+ data_use_matcher_->FetchMatchingRules();
+ }
}
base::TimeTicks DataUseTabModel::NowTicks() const {
« no previous file with comments | « no previous file | chrome/browser/android/data_usage/external_data_use_observer_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698