| OLD | NEW |
| 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.webapps; | 5 package org.chromium.chrome.browser.webapps; |
| 6 | 6 |
| 7 import android.app.Activity; | 7 import android.app.Activity; |
| 8 import android.graphics.Bitmap; | 8 import android.graphics.Bitmap; |
| 9 | 9 |
| 10 import org.chromium.base.annotations.CalledByNative; | 10 import org.chromium.base.annotations.CalledByNative; |
| (...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 61 } | 61 } |
| 62 | 62 |
| 63 /** | 63 /** |
| 64 * Adds a shortcut for the current Tab. | 64 * Adds a shortcut for the current Tab. |
| 65 * @param userRequestedTitle Title of the shortcut displayed on the homescre
en. | 65 * @param userRequestedTitle Title of the shortcut displayed on the homescre
en. |
| 66 */ | 66 */ |
| 67 public void addShortcut(String userRequestedTitle) { | 67 public void addShortcut(String userRequestedTitle) { |
| 68 nativeAddShortcut(mNativeAddToHomescreenManager, userRequestedTitle); | 68 nativeAddShortcut(mNativeAddToHomescreenManager, userRequestedTitle); |
| 69 } | 69 } |
| 70 | 70 |
| 71 public void onDismissed() { | 71 @CalledByNative |
| 72 public void onFinished() { |
| 72 destroy(); | 73 destroy(); |
| 73 } | 74 } |
| 74 | 75 |
| 75 /** | 76 /** |
| 76 * Shows alert to prompt user for name of home screen shortcut. | 77 * Shows alert to prompt user for name of home screen shortcut. |
| 77 */ | 78 */ |
| 78 @CalledByNative | 79 @CalledByNative |
| 79 public void showDialog() { | 80 public void showDialog() { |
| 80 AddToHomescreenDialog dialog = new AddToHomescreenDialog(this); | 81 AddToHomescreenDialog dialog = new AddToHomescreenDialog(this); |
| 81 dialog.show(mActivity); | 82 dialog.show(mActivity); |
| 82 setObserver(dialog); | 83 setObserver(dialog); |
| 83 } | 84 } |
| 84 | 85 |
| 85 @CalledByNative | 86 @CalledByNative |
| 86 private void onUserTitleAvailable(String title) { | 87 private void onUserTitleAvailable(String title) { |
| 87 mObserver.onUserTitleAvailable(title); | 88 mObserver.onUserTitleAvailable(title); |
| 88 } | 89 } |
| 89 | 90 |
| 90 @CalledByNative | 91 @CalledByNative |
| 91 private void onReadyToAdd(Bitmap icon) { | 92 private void onReadyToAdd(Bitmap icon) { |
| 92 mObserver.onReadyToAdd(icon); | 93 mObserver.onReadyToAdd(icon); |
| 93 } | 94 } |
| 94 | 95 |
| 95 private native long nativeInitializeAndStart(WebContents webContents); | 96 private native long nativeInitializeAndStart(WebContents webContents); |
| 96 private native void nativeAddShortcut( | 97 private native void nativeAddShortcut( |
| 97 long nativeAddToHomescreenManager, String userRequestedTitle); | 98 long nativeAddToHomescreenManager, String userRequestedTitle); |
| 98 private native void nativeDestroy(long nativeAddToHomescreenManager); | 99 private native void nativeDestroy(long nativeAddToHomescreenManager); |
| 99 } | 100 } |
| OLD | NEW |