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

Side by Side Diff: content/browser/android/content_view_core_impl.cc

Issue 93903011: Remove 'using base::string16;' from base/strings/string16.h and remove temporary (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: asdf Created 6 years, 11 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 | Annotate | Revision Log
OLDNEW
1 // Copyright 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/android/content_view_core_impl.h" 5 #include "content/browser/android/content_view_core_impl.h"
6 6
7 #include "base/android/jni_android.h" 7 #include "base/android/jni_android.h"
8 #include "base/android/jni_array.h" 8 #include "base/android/jni_array.h"
9 #include "base/android/jni_string.h" 9 #include "base/android/jni_string.h"
10 #include "base/android/scoped_java_ref.h" 10 #include "base/android/scoped_java_ref.h"
(...skipping 1633 matching lines...) Expand 10 before | Expand all | Expand 10 after
1644 static_cast<int>(x / GetDpiScale()), 1644 static_cast<int>(x / GetDpiScale()),
1645 static_cast<int>(y / GetDpiScale()), 1645 static_cast<int>(y / GetDpiScale()),
1646 static_cast<int>((width > 0 && width < GetDpiScale()) ? 1646 static_cast<int>((width > 0 && width < GetDpiScale()) ?
1647 1 : (int)(width / GetDpiScale())), 1647 1 : (int)(width / GetDpiScale())),
1648 static_cast<int>((height > 0 && height < GetDpiScale()) ? 1648 static_cast<int>((height > 0 && height < GetDpiScale()) ?
1649 1 : (int)(height / GetDpiScale()))); 1649 1 : (int)(height / GetDpiScale())));
1650 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData( 1650 GetWebContents()->Send(new ViewMsg_ExtractSmartClipData(
1651 GetWebContents()->GetRoutingID(), rect)); 1651 GetWebContents()->GetRoutingID(), rect));
1652 } 1652 }
1653 1653
1654 void ContentViewCoreImpl::OnSmartClipDataExtracted(const string16& result) { 1654 void ContentViewCoreImpl::OnSmartClipDataExtracted(
1655 const base::string16& result) {
1655 JNIEnv* env = AttachCurrentThread(); 1656 JNIEnv* env = AttachCurrentThread();
1656 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env); 1657 ScopedJavaLocalRef<jobject> obj = java_ref_.get(env);
1657 if (obj.is_null()) 1658 if (obj.is_null())
1658 return; 1659 return;
1659 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result); 1660 ScopedJavaLocalRef<jstring> jresult = ConvertUTF16ToJavaString(env, result);
1660 Java_ContentViewCore_onSmartClipDataExtracted( 1661 Java_ContentViewCore_onSmartClipDataExtracted(
1661 env, obj.obj(), jresult.obj()); 1662 env, obj.obj(), jresult.obj());
1662 } 1663 }
1663 1664
1664 // This is called for each ContentView. 1665 // This is called for each ContentView.
1665 jlong Init(JNIEnv* env, jobject obj, 1666 jlong Init(JNIEnv* env, jobject obj,
1666 jboolean hardware_accelerated, 1667 jboolean hardware_accelerated,
1667 jlong native_web_contents, 1668 jlong native_web_contents,
1668 jlong view_android, 1669 jlong view_android,
1669 jlong window_android) { 1670 jlong window_android) {
1670 ContentViewCoreImpl* view = new ContentViewCoreImpl( 1671 ContentViewCoreImpl* view = new ContentViewCoreImpl(
1671 env, obj, hardware_accelerated, 1672 env, obj, hardware_accelerated,
1672 reinterpret_cast<WebContents*>(native_web_contents), 1673 reinterpret_cast<WebContents*>(native_web_contents),
1673 reinterpret_cast<ui::ViewAndroid*>(view_android), 1674 reinterpret_cast<ui::ViewAndroid*>(view_android),
1674 reinterpret_cast<ui::WindowAndroid*>(window_android)); 1675 reinterpret_cast<ui::WindowAndroid*>(window_android));
1675 return reinterpret_cast<intptr_t>(view); 1676 return reinterpret_cast<intptr_t>(view);
1676 } 1677 }
1677 1678
1678 bool RegisterContentViewCore(JNIEnv* env) { 1679 bool RegisterContentViewCore(JNIEnv* env) {
1679 return RegisterNativesImpl(env); 1680 return RegisterNativesImpl(env);
1680 } 1681 }
1681 1682
1682 } // namespace content 1683 } // namespace content
OLDNEW
« no previous file with comments | « content/browser/android/content_view_core_impl.h ('k') | content/browser/renderer_host/render_widget_host_view_android.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698