// Implements SmartClipProvider
 @Override
 public void setSmartClipResultHandler(final Handler resultHandler) {
   if (resultHandler == null) {
     mContentViewCore.setSmartClipDataListener(null);
     return;
   }
   mContentViewCore.setSmartClipDataListener(
       new ContentViewCore.SmartClipDataListener() {
         @Override
         public void onSmartClipDataExtracted(String text, String html, Rect clipRect) {
           Bundle bundle = new Bundle();
           bundle.putString("url", mContentViewCore.getWebContents().getVisibleUrl());
           bundle.putString("title", mContentViewCore.getWebContents().getTitle());
           bundle.putParcelable("rect", clipRect);
           bundle.putString("text", text);
           bundle.putString("html", html);
           try {
             Message msg = Message.obtain(resultHandler, 0);
             msg.setData(bundle);
             msg.sendToTarget();
           } catch (Exception e) {
             Log.e(TAG, "Error calling handler for smart clip data: ", e);
           }
         }
       });
 }