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

Side by Side Diff: chrome/android/java/src/org/chromium/chrome/browser/webshare/ShareServiceImpl.java

Issue 2081153005: [Offline Page] Offline page sharing implementation (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Grammar fix Created 4 years, 4 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 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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.chrome.browser.webshare; 5 package org.chromium.chrome.browser.webshare;
6 6
7 import android.app.Activity; 7 import android.app.Activity;
8 import android.content.ComponentName; 8 import android.content.ComponentName;
9 import android.support.annotation.Nullable; 9 import android.support.annotation.Nullable;
10 10
(...skipping 27 matching lines...) Expand all
38 callback.call("Share failed"); 38 callback.call("Share failed");
39 return; 39 return;
40 } 40 }
41 41
42 ShareHelper.TargetChosenCallback innerCallback = new ShareHelper.TargetC hosenCallback() { 42 ShareHelper.TargetChosenCallback innerCallback = new ShareHelper.TargetC hosenCallback() {
43 public void onTargetChosen(ComponentName chosenComponent) { 43 public void onTargetChosen(ComponentName chosenComponent) {
44 callback.call(null); 44 callback.call(null);
45 } 45 }
46 }; 46 };
47 47
48 ShareHelper.share(false, false, mActivity, title, text, null, null, inne rCallback); 48 ShareHelper.share(false, false, mActivity, title, text, null, null, null , innerCallback);
49 } 49 }
50 50
51 @Nullable 51 @Nullable
52 private static Activity activityFromWebContents(@Nullable WebContents webCon tents) { 52 private static Activity activityFromWebContents(@Nullable WebContents webCon tents) {
53 if (webContents == null) return null; 53 if (webContents == null) return null;
54 54
55 ContentViewCore contentViewCore = ContentViewCore.fromWebContents(webCon tents); 55 ContentViewCore contentViewCore = ContentViewCore.fromWebContents(webCon tents);
56 if (contentViewCore == null) return null; 56 if (contentViewCore == null) return null;
57 57
58 WindowAndroid window = contentViewCore.getWindowAndroid(); 58 WindowAndroid window = contentViewCore.getWindowAndroid();
59 if (window == null) return null; 59 if (window == null) return null;
60 60
61 return window.getActivity().get(); 61 return window.getActivity().get();
62 } 62 }
63 } 63 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698