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/download/download_manager_service.h" | 5 #include "chrome/browser/android/download/download_manager_service.h" |
6 | 6 |
7 #include "base/android/jni_string.h" | 7 #include "base/android/jni_string.h" |
8 #include "base/location.h" | 8 #include "base/location.h" |
9 #include "base/single_thread_task_runner.h" | 9 #include "base/single_thread_task_runner.h" |
10 #include "base/threading/thread_task_runner_handle.h" | 10 #include "base/threading/thread_task_runner_handle.h" |
(...skipping 423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 content::DownloadManager* manager = | 434 content::DownloadManager* manager = |
435 content::BrowserContext::GetDownloadManager(profile); | 435 content::BrowserContext::GetDownloadManager(profile); |
436 | 436 |
437 // Update notifiers to monitor any newly created DownloadManagers. | 437 // Update notifiers to monitor any newly created DownloadManagers. |
438 updateNotifier( | 438 updateNotifier( |
439 this, manager, | 439 this, manager, |
440 is_off_the_record ? off_the_record_notifier_ : original_notifier_); | 440 is_off_the_record ? off_the_record_notifier_ : original_notifier_); |
441 | 441 |
442 return manager; | 442 return manager; |
443 } | 443 } |
| 444 |
| 445 // static |
| 446 jboolean IsSupportedMimeType( |
| 447 JNIEnv* env, |
| 448 const JavaParamRef<jclass>& clazz, |
| 449 const JavaParamRef<jstring>& jmime_type) { |
| 450 std::string mime_type = ConvertJavaStringToUTF8(env, jmime_type); |
| 451 return mime_util::IsSupportedMimeType(mime_type); |
| 452 } |
OLD | NEW |