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 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_BRIDGE_H_ | 5 #ifndef CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_BRIDGE_H_ |
6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_BRIDGE_H_ | 6 #define CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_BRIDGE_H_ |
7 | 7 |
8 #include <jni.h> | 8 #include <jni.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
(...skipping 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
91 // installed or uninstalled. |is_control_app_installed| is true if app is | 91 // installed or uninstalled. |is_control_app_installed| is true if app is |
92 // installed. | 92 // installed. |
93 void OnControlAppInstallStateChange(JNIEnv* env, | 93 void OnControlAppInstallStateChange(JNIEnv* env, |
94 jobject obj, | 94 jobject obj, |
95 bool is_control_app_installed) const; | 95 bool is_control_app_installed) const; |
96 | 96 |
97 // Called by DataUseMatcher to notify |external_data_use_observer_| if it | 97 // Called by DataUseMatcher to notify |external_data_use_observer_| if it |
98 // should register as a data use observer. | 98 // should register as a data use observer. |
99 virtual void ShouldRegisterAsDataUseObserver(bool should_register) const; | 99 virtual void ShouldRegisterAsDataUseObserver(bool should_register) const; |
100 | 100 |
| 101 void SetRegisterGoogleVariationID(bool register_google_variation_id); |
| 102 |
101 private: | 103 private: |
102 // Java listener that provides regular expressions to |this|. Data use | 104 // Java listener that provides regular expressions to |this|. Data use |
103 // reports are submitted to |j_external_data_use_observer_|. | 105 // reports are submitted to |j_external_data_use_observer_|. |
104 base::android::ScopedJavaGlobalRef<jobject> j_external_data_use_observer_; | 106 base::android::ScopedJavaGlobalRef<jobject> j_external_data_use_observer_; |
105 | 107 |
106 // |external_data_use_observer_| owns |this|. |external_data_use_observer_| is | 108 // |external_data_use_observer_| owns |this|. |external_data_use_observer_| is |
107 // notified of results from Java code by |this|. | 109 // notified of results from Java code by |this|. |
108 base::WeakPtr<ExternalDataUseObserver> external_data_use_observer_; | 110 base::WeakPtr<ExternalDataUseObserver> external_data_use_observer_; |
109 | 111 |
110 // |data_use_tab_model_| is notified of the matching rules on UI thread. | 112 // |data_use_tab_model_| is notified of the matching rules on UI thread. |
111 // |data_use_tab_model_| may be null. | 113 // |data_use_tab_model_| may be null. |
112 base::WeakPtr<DataUseTabModel> data_use_tab_model_; | 114 base::WeakPtr<DataUseTabModel> data_use_tab_model_; |
113 | 115 |
114 // The construction time of |this|. | 116 // The construction time of |this|. |
115 const base::TimeTicks construct_time_; | 117 const base::TimeTicks construct_time_; |
116 | 118 |
117 // True if matching rules are fetched for the first time. | 119 // True if matching rules are fetched for the first time. |
118 bool is_first_matching_rule_fetch_; | 120 bool is_first_matching_rule_fetch_; |
119 | 121 |
| 122 // True if Google variation ID should be registered. |
| 123 bool register_google_variation_id_; |
| 124 |
120 // |io_task_runner_| accesses ExternalDataUseObserver members on IO thread. | 125 // |io_task_runner_| accesses ExternalDataUseObserver members on IO thread. |
121 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; | 126 scoped_refptr<base::SingleThreadTaskRunner> io_task_runner_; |
122 | 127 |
123 base::ThreadChecker thread_checker_; | 128 base::ThreadChecker thread_checker_; |
124 | 129 |
125 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserverBridge); | 130 DISALLOW_COPY_AND_ASSIGN(ExternalDataUseObserverBridge); |
126 }; | 131 }; |
127 | 132 |
128 bool RegisterExternalDataUseObserver(JNIEnv* env); | 133 bool RegisterExternalDataUseObserver(JNIEnv* env); |
129 | 134 |
130 } // namespace android | 135 } // namespace android |
131 | 136 |
132 } // namespace chrome | 137 } // namespace chrome |
133 | 138 |
134 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_BRIDGE_H
_ | 139 #endif // CHROME_BROWSER_ANDROID_DATA_USAGE_EXTERNAL_DATA_USE_OBSERVER_BRIDGE_H
_ |
OLD | NEW |