| OLD | NEW |
| 1 // Copyright 2017 The Chromium Authors. All rights reserved. | 1 // Copyright 2017 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.infobar; | 5 package org.chromium.chrome.browser.infobar; |
| 6 | 6 |
| 7 import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; | 7 import org.chromium.chrome.browser.snackbar.SnackbarManager.SnackbarController; |
| 8 | 8 |
| 9 /** | 9 /** |
| 10 * The controller for translate UI snackbars. | 10 * The controller for translate UI snackbars. |
| 11 */ | 11 */ |
| 12 class TranslateSnackbarController implements SnackbarController { | 12 class TranslateSnackbarController implements SnackbarController { |
| 13 @Override | 13 @Override |
| 14 public void onDismissNoAction(Object actionData) { | 14 public void onDismissNoAction(Object actionData) { |
| 15 // No action. | 15 // No action. |
| 16 } | 16 } |
| 17 | 17 |
| 18 @Override | 18 @Override |
| 19 public void onAction(Object actionData) { | 19 public void onAction(Object actionData) { |
| 20 nativeToggleTranslateOption(((Integer) actionData).intValue()); | 20 nativeToggleTranslateOption(((Long) actionData).longValue()); |
| 21 } | 21 } |
| 22 | 22 |
| 23 private static native void nativeToggleTranslateOption(int type); | 23 private native void nativeToggleTranslateOption(long nativeTranslateSnackbar
); |
| 24 }; | 24 }; |
| OLD | NEW |