Chromium Code Reviews| OLD | NEW |
|---|---|
| (Empty) | |
| 1 /* | |
| 2 * Copyright (C) 2017 The Android Open Source Project | |
| 3 * | |
| 4 * Licensed under the Apache License, Version 2.0 (the "License"); | |
| 5 * you may not use this file except in compliance with the License. | |
| 6 * You may obtain a copy of the License at | |
| 7 * | |
| 8 * http://www.apache.org/licenses/LICENSE-2.0 | |
| 9 * | |
| 10 * Unless required by applicable law or agreed to in writing, software | |
| 11 * distributed under the License is distributed on an "AS IS" BASIS, | |
| 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 13 * See the License for the specific language governing permissions and | |
| 14 * limitations under the License. | |
| 15 */ | |
| 16 | |
| 17 package android.support.customtabs.browseraction; | |
| 18 | |
| 19 import android.app.PendingIntent; | |
| 20 import android.graphics.Bitmap; | |
| 21 | |
| 22 /** | |
| 23 * A wrapper class holding custom item for browser action menu. | |
| 24 * The Bitmap is optional for a BrowserActionItem. | |
| 25 */ | |
| 26 public class BrowserActionItem { | |
| 27 private String mTitle; | |
|
Yusuf
2017/04/03 18:00:49
final for title and action
ltian
2017/04/05 01:44:28
Done.
| |
| 28 private PendingIntent mAction; | |
| 29 private Bitmap mIcon; | |
| 30 | |
| 31 /** | |
| 32 * Constructor for BrowserActionItem with icon, string and action provided. | |
| 33 * @param icon The icon shown for a custom item. | |
| 34 * @param title The string shown for a custom item. | |
| 35 * @param action The PendingIntent executed when a custom item is selected | |
| 36 */ | |
| 37 public BrowserActionItem(String title, PendingIntent action, Bitmap icon) { | |
|
Yusuf
2017/04/03 18:00:49
@Nonnull for the two that cant be null
ltian
2017/04/05 01:44:29
Done.
| |
| 38 mTitle = title; | |
| 39 mAction = action; | |
| 40 mIcon = icon; | |
| 41 } | |
| 42 | |
| 43 /** | |
| 44 * Constructor for BrowserActionItem with only string and action provided. | |
| 45 * @param title The icon shown for a custom item. | |
| 46 * @param action The string shown for a custom item. | |
| 47 */ | |
| 48 public BrowserActionItem(String title, PendingIntent action) { | |
|
Yusuf
2017/04/03 18:00:49
@NonNull for both
ltian
2017/04/05 01:44:29
Done.
| |
| 49 mTitle = title; | |
|
Yusuf
2017/04/03 18:00:49
call the above constructor with params set from he
ltian
2017/04/05 01:44:28
Done.
| |
| 50 mAction = action; | |
| 51 } | |
| 52 | |
| 53 public void setIcon(Bitmap icon) { | |
|
Yusuf
2017/04/03 18:00:48
javadocs here and on other getters.
ltian
2017/04/05 01:44:29
Done.
| |
| 54 mIcon = icon; | |
| 55 } | |
| 56 | |
| 57 public Bitmap getIcon() { | |
| 58 return mIcon; | |
| 59 } | |
| 60 | |
| 61 public String getTitle() { | |
| 62 return mTitle; | |
| 63 } | |
| 64 | |
| 65 public PendingIntent getAction() { | |
| 66 return mAction; | |
| 67 } | |
| 68 } | |
| OLD | NEW |