| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |