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

Side by Side Diff: chrome/browser/android/data_usage/external_data_use_observer.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 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 #include "chrome/browser/android/data_usage/external_data_use_observer.h" 5 #include "chrome/browser/android/data_usage/external_data_use_observer.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/containers/hash_tables.h" 10 #include "base/containers/hash_tables.h"
(...skipping 397 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 for (const auto& matching_rule : matching_rules_) { 408 for (const auto& matching_rule : matching_rules_) {
409 if (app_package_name == matching_rule->app_package_name()) { 409 if (app_package_name == matching_rule->app_package_name()) {
410 *label = matching_rule->label(); 410 *label = matching_rule->label();
411 return true; 411 return true;
412 } 412 }
413 } 413 }
414 414
415 return false; 415 return false;
416 } 416 }
417 417
418 DataUseTabModel* ExternalDataUseObserver::GetDataUseTabModel() const {
419 DCHECK(thread_checker_.CalledOnValidThread());
420 return data_use_tab_model_.get();
421 }
422
418 ExternalDataUseObserver::DataUseReportKey::DataUseReportKey( 423 ExternalDataUseObserver::DataUseReportKey::DataUseReportKey(
419 const std::string& label, 424 const std::string& label,
420 net::NetworkChangeNotifier::ConnectionType connection_type, 425 net::NetworkChangeNotifier::ConnectionType connection_type,
421 const std::string& mcc_mnc) 426 const std::string& mcc_mnc)
422 : label(label), connection_type(connection_type), mcc_mnc(mcc_mnc) {} 427 : label(label), connection_type(connection_type), mcc_mnc(mcc_mnc) {}
423 428
424 bool ExternalDataUseObserver::DataUseReportKey::operator==( 429 bool ExternalDataUseObserver::DataUseReportKey::operator==(
425 const DataUseReportKey& other) const { 430 const DataUseReportKey& other) const {
426 return label == other.label && connection_type == other.connection_type && 431 return label == other.label && connection_type == other.connection_type &&
427 mcc_mnc == other.mcc_mnc; 432 mcc_mnc == other.mcc_mnc;
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after
477 return label_; 482 return label_;
478 } 483 }
479 484
480 bool RegisterExternalDataUseObserver(JNIEnv* env) { 485 bool RegisterExternalDataUseObserver(JNIEnv* env) {
481 return RegisterNativesImpl(env); 486 return RegisterNativesImpl(env);
482 } 487 }
483 488
484 } // namespace android 489 } // namespace android
485 490
486 } // namespace chrome 491 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698