| 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/history_report/history_report_jni_bridge.h" | 5 #include "chrome/browser/android/history_report/history_report_jni_bridge.h" |
| 6 | 6 |
| 7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <stdint.h> | 8 #include <stdint.h> |
| 9 | 9 |
| 10 #include <vector> | 10 #include <vector> |
| (...skipping 34 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 45 HistoryReportJniBridge::HistoryReportJniBridge(JNIEnv* env, jobject obj) | 45 HistoryReportJniBridge::HistoryReportJniBridge(JNIEnv* env, jobject obj) |
| 46 : weak_java_provider_(env, obj) { | 46 : weak_java_provider_(env, obj) { |
| 47 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); | 47 DCHECK_CURRENTLY_ON(content::BrowserThread::UI); |
| 48 Profile* profile = g_browser_process->profile_manager()-> | 48 Profile* profile = g_browser_process->profile_manager()-> |
| 49 GetLastUsedProfile()->GetOriginalProfile(); | 49 GetLastUsedProfile()->GetOriginalProfile(); |
| 50 | 50 |
| 51 delta_file_service_.reset(new DeltaFileService(profile->GetPath())); | 51 delta_file_service_.reset(new DeltaFileService(profile->GetPath())); |
| 52 usage_reports_buffer_service_.reset( | 52 usage_reports_buffer_service_.reset( |
| 53 new UsageReportsBufferService(profile->GetPath())); | 53 new UsageReportsBufferService(profile->GetPath())); |
| 54 usage_reports_buffer_service_->Init(); | 54 usage_reports_buffer_service_->Init(); |
| 55 bookmark_model_.reset(BookmarkModelFactory::GetForProfile(profile)); | 55 bookmark_model_.reset(BookmarkModelFactory::GetForBrowserContext(profile)); |
| 56 base::Callback<void(void)> on_change = base::Bind( | 56 base::Callback<void(void)> on_change = base::Bind( |
| 57 &history_report::HistoryReportJniBridge::NotifyDataChanged, | 57 &history_report::HistoryReportJniBridge::NotifyDataChanged, |
| 58 base::Unretained(this)); | 58 base::Unretained(this)); |
| 59 base::Callback<void(void)> on_clear = base::Bind( | 59 base::Callback<void(void)> on_clear = base::Bind( |
| 60 &history_report::HistoryReportJniBridge::NotifyDataCleared, | 60 &history_report::HistoryReportJniBridge::NotifyDataCleared, |
| 61 base::Unretained(this)); | 61 base::Unretained(this)); |
| 62 base::Callback<void(void)> stop_reporting = base::Bind( | 62 base::Callback<void(void)> stop_reporting = base::Bind( |
| 63 &history_report::HistoryReportJniBridge::StopReporting, | 63 &history_report::HistoryReportJniBridge::StopReporting, |
| 64 base::Unretained(this)); | 64 base::Unretained(this)); |
| 65 history::HistoryService* history_service = | 65 history::HistoryService* history_service = |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 192 base::android::ScopedJavaLocalRef<jstring> HistoryReportJniBridge::Dump( | 192 base::android::ScopedJavaLocalRef<jstring> HistoryReportJniBridge::Dump( |
| 193 JNIEnv* env, | 193 JNIEnv* env, |
| 194 const JavaParamRef<jobject>& obj) { | 194 const JavaParamRef<jobject>& obj) { |
| 195 std::string dump; | 195 std::string dump; |
| 196 dump.append(delta_file_service_->Dump()); | 196 dump.append(delta_file_service_->Dump()); |
| 197 dump.append(usage_reports_buffer_service_->Dump()); | 197 dump.append(usage_reports_buffer_service_->Dump()); |
| 198 return base::android::ConvertUTF8ToJavaString(env, dump); | 198 return base::android::ConvertUTF8ToJavaString(env, dump); |
| 199 } | 199 } |
| 200 | 200 |
| 201 } // namespace history_report | 201 } // namespace history_report |
| OLD | NEW |