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

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

Powered by Google App Engine
This is Rietveld 408576698