OLD | NEW |
---|---|
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 package org.chromium.content.browser; | 5 package org.chromium.content.browser; |
6 | 6 |
7 import android.content.Context; | 7 import android.content.Context; |
8 import android.content.res.Configuration; | 8 import android.content.res.Configuration; |
9 import android.graphics.Canvas; | 9 import android.graphics.Canvas; |
10 import android.graphics.Rect; | 10 import android.graphics.Rect; |
11 import android.os.Bundle; | 11 import android.os.Bundle; |
12 import android.os.Handler; | 12 import android.os.Handler; |
13 import android.os.Message; | 13 import android.os.Message; |
14 import android.util.Log; | |
15 import android.view.KeyEvent; | 14 import android.view.KeyEvent; |
16 import android.view.MotionEvent; | 15 import android.view.MotionEvent; |
17 import android.view.View; | 16 import android.view.View; |
18 import android.view.accessibility.AccessibilityNodeProvider; | 17 import android.view.accessibility.AccessibilityNodeProvider; |
19 import android.view.inputmethod.EditorInfo; | 18 import android.view.inputmethod.EditorInfo; |
20 import android.view.inputmethod.InputConnection; | 19 import android.view.inputmethod.InputConnection; |
21 import android.widget.FrameLayout; | 20 import android.widget.FrameLayout; |
22 | 21 |
22 import org.chromium.base.Log; | |
23 import org.chromium.base.TraceEvent; | 23 import org.chromium.base.TraceEvent; |
24 | 24 |
25 /** | 25 /** |
26 * The containing view for {@link ContentViewCore} that exists in the Android UI hierarchy and | 26 * The containing view for {@link ContentViewCore} that exists in the Android UI hierarchy and |
27 * exposes the various {@link View} functionality to it. | 27 * exposes the various {@link View} functionality to it. |
28 */ | 28 */ |
29 public class ContentView extends FrameLayout | 29 public class ContentView extends FrameLayout |
30 implements ContentViewCore.InternalAccessDelegate, SmartClipProvider { | 30 implements ContentViewCore.InternalAccessDelegate, SmartClipProvider { |
31 | 31 |
32 private static final String TAG = "ContentView"; | 32 private static final String TAG = "cr.ContentView"; |
33 | 33 |
34 protected final ContentViewCore mContentViewCore; | 34 protected final ContentViewCore mContentViewCore; |
35 | 35 |
36 /** | 36 /** |
37 * Creates an instance of a ContentView. | 37 * Creates an instance of a ContentView. |
38 * @param context The Context the view is running in, through which it can | 38 * @param context The Context the view is running in, through which it can |
39 * access the current theme, resources, etc. | 39 * access the current theme, resources, etc. |
40 * @param cvc A pointer to the content view core managing this content view. | 40 * @param cvc A pointer to the content view core managing this content view. |
41 */ | 41 */ |
42 public ContentView(Context context, ContentViewCore cvc) { | 42 public ContentView(Context context, ContentViewCore cvc) { |
(...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
271 bundle.putString("url", mContentViewCore.getWebContents().getVis ibleUrl()); | 271 bundle.putString("url", mContentViewCore.getWebContents().getVis ibleUrl()); |
272 bundle.putString("title", mContentViewCore.getWebContents().getT itle()); | 272 bundle.putString("title", mContentViewCore.getWebContents().getT itle()); |
273 bundle.putParcelable("rect", clipRect); | 273 bundle.putParcelable("rect", clipRect); |
274 bundle.putString("text", text); | 274 bundle.putString("text", text); |
275 bundle.putString("html", html); | 275 bundle.putString("html", html); |
276 try { | 276 try { |
277 Message msg = Message.obtain(resultHandler, 0); | 277 Message msg = Message.obtain(resultHandler, 0); |
278 msg.setData(bundle); | 278 msg.setData(bundle); |
279 msg.sendToTarget(); | 279 msg.sendToTarget(); |
280 } catch (Exception e) { | 280 } catch (Exception e) { |
281 Log.e(TAG, "Error calling handler for smart clip data: ", e) ; | 281 Log.e(TAG, "Error calling handler for smart clip data: ", e) ; |
AKVT
2015/06/16 08:48:53
Log.e(TAG, "Error calling handler for smart clip d
| |
282 } | 282 } |
283 } | 283 } |
284 }); | 284 }); |
285 } | 285 } |
286 | 286 |
287 //////////////////////////////////////////////////////////////////////////// /////////////////// | 287 //////////////////////////////////////////////////////////////////////////// /////////////////// |
288 // Start Implementation of ContentViewCore.InternalAccessDelega te // | 288 // Start Implementation of ContentViewCore.InternalAccessDelega te // |
289 //////////////////////////////////////////////////////////////////////////// /////////////////// | 289 //////////////////////////////////////////////////////////////////////////// /////////////////// |
290 | 290 |
291 @Override | 291 @Override |
(...skipping 23 matching lines...) Expand all Loading... | |
315 | 315 |
316 @Override | 316 @Override |
317 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { | 317 public boolean super_awakenScrollBars(int startDelay, boolean invalidate) { |
318 return super.awakenScrollBars(startDelay, invalidate); | 318 return super.awakenScrollBars(startDelay, invalidate); |
319 } | 319 } |
320 | 320 |
321 //////////////////////////////////////////////////////////////////////////// /////////////////// | 321 //////////////////////////////////////////////////////////////////////////// /////////////////// |
322 // End Implementation of ContentViewCore.InternalAccessDelega te // | 322 // End Implementation of ContentViewCore.InternalAccessDelega te // |
323 //////////////////////////////////////////////////////////////////////////// /////////////////// | 323 //////////////////////////////////////////////////////////////////////////// /////////////////// |
324 } | 324 } |
OLD | NEW |