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

Side by Side Diff: content/browser/web_contents/web_contents_android.cc

Issue 2014803002: Move DownloadControllerAndroid from content/ to chrome/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: moved download delegate interface to native Created 4 years, 6 months 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 2013 The Chromium Authors. All rights reserved. 1 // Copyright 2013 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 "content/browser/web_contents/web_contents_android.h" 5 #include "content/browser/web_contents/web_contents_android.h"
6 6
7 #include <stdint.h> 7 #include <stdint.h>
8 8
9 #include "base/android/jni_android.h" 9 #include "base/android/jni_android.h"
10 #include "base/android/jni_array.h" 10 #include "base/android/jni_array.h"
(...skipping 11 matching lines...) Expand all
22 #include "content/browser/media/android/browser_media_player_manager.h" 22 #include "content/browser/media/android/browser_media_player_manager.h"
23 #include "content/browser/media/android/media_web_contents_observer_android.h" 23 #include "content/browser/media/android/media_web_contents_observer_android.h"
24 #include "content/browser/renderer_host/render_view_host_impl.h" 24 #include "content/browser/renderer_host/render_view_host_impl.h"
25 #include "content/browser/web_contents/web_contents_impl.h" 25 #include "content/browser/web_contents/web_contents_impl.h"
26 #include "content/common/devtools_messages.h" 26 #include "content/common/devtools_messages.h"
27 #include "content/common/frame_messages.h" 27 #include "content/common/frame_messages.h"
28 #include "content/common/input_messages.h" 28 #include "content/common/input_messages.h"
29 #include "content/common/view_messages.h" 29 #include "content/common/view_messages.h"
30 #include "content/public/browser/browser_context.h" 30 #include "content/public/browser/browser_context.h"
31 #include "content/public/browser/browser_thread.h" 31 #include "content/public/browser/browser_thread.h"
32 #include "content/public/browser/android/download_delegate.h"
32 #include "content/public/browser/message_port_provider.h" 33 #include "content/public/browser/message_port_provider.h"
33 #include "content/public/browser/render_widget_host.h" 34 #include "content/public/browser/render_widget_host.h"
34 #include "content/public/browser/web_contents.h" 35 #include "content/public/browser/web_contents.h"
35 #include "content/public/common/content_switches.h" 36 #include "content/public/common/content_switches.h"
36 #include "jni/WebContentsImpl_jni.h" 37 #include "jni/WebContentsImpl_jni.h"
37 #include "net/android/network_library.h" 38 #include "net/android/network_library.h"
38 #include "ui/accessibility/ax_node_data.h" 39 #include "ui/accessibility/ax_node_data.h"
39 #include "ui/gfx/android/device_display_info.h" 40 #include "ui/gfx/android/device_display_info.h"
40 #include "ui/gfx/android/java_bitmap.h" 41 #include "ui/gfx/android/java_bitmap.h"
41 #include "ui/gfx/geometry/rect.h" 42 #include "ui/gfx/geometry/rect.h"
42 43
43 using base::android::AttachCurrentThread; 44 using base::android::AttachCurrentThread;
44 using base::android::ConvertJavaStringToUTF8; 45 using base::android::ConvertJavaStringToUTF8;
45 using base::android::ConvertJavaStringToUTF16; 46 using base::android::ConvertJavaStringToUTF16;
46 using base::android::ConvertUTF8ToJavaString; 47 using base::android::ConvertUTF8ToJavaString;
47 using base::android::ConvertUTF16ToJavaString; 48 using base::android::ConvertUTF16ToJavaString;
48 using base::android::JavaParamRef; 49 using base::android::JavaParamRef;
49 using base::android::ScopedJavaGlobalRef; 50 using base::android::ScopedJavaGlobalRef;
51 using base::android::ScopedJavaLocalRef;
50 using base::android::ToJavaIntArray; 52 using base::android::ToJavaIntArray;
51 53
52 namespace content { 54 namespace content {
53 55
54 namespace { 56 namespace {
55 57
56 // Track all WebContentsAndroid objects here so that we don't deserialize a 58 // Track all WebContentsAndroid objects here so that we don't deserialize a
57 // destroyed WebContents object. 59 // destroyed WebContents object.
58 base::LazyInstance<base::hash_set<WebContentsAndroid*> >::Leaky 60 base::LazyInstance<base::hash_set<WebContentsAndroid*> >::Leaky
59 g_allocated_web_contents_androids = LAZY_INSTANCE_INITIALIZER; 61 g_allocated_web_contents_androids = LAZY_INSTANCE_INITIALIZER;
(...skipping 622 matching lines...) Expand 10 before | Expand all | Expand 10 after
682 ScopedJavaLocalRef<jobject> java_bitmap; 684 ScopedJavaLocalRef<jobject> java_bitmap;
683 if (response == READBACK_SUCCESS) 685 if (response == READBACK_SUCCESS)
684 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap); 686 java_bitmap = gfx::ConvertToJavaBitmap(&bitmap);
685 Java_WebContentsImpl_onGetContentBitmapFinished(env, 687 Java_WebContentsImpl_onGetContentBitmapFinished(env,
686 obj->obj(), 688 obj->obj(),
687 callback->obj(), 689 callback->obj(),
688 java_bitmap.obj(), 690 java_bitmap.obj(),
689 response); 691 response);
690 } 692 }
691 693
694 void WebContentsAndroid::SetDownloadDelegate(
695 DownloadDelegate* delegate) {
696 download_delegate_ = delegate;
697 }
698
699 DownloadDelegate* WebContentsAndroid::GetDownloadDelegate() {
700 return download_delegate_;
701 }
702
692 } // namespace content 703 } // namespace content
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698