| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
const tab_groups::TabGroupVisualData* visual_data = tab_group->visual_data();Before if a user wanted to just set the title, they would call this method, while keeping the other properties the same (color and is_collopased).
With the new methods, a user will override all the properties. It is the intended behavior?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Zoraiz, please take another look.
const tab_groups::TabGroupVisualData* visual_data = tab_group->visual_data();Before if a user wanted to just set the title, they would call this method, while keeping the other properties the same (color and is_collopased).
With the new methods, a user will override all the properties. It is the intended behavior?
Yes, this is the way in generally works on Win/Mac/Linux/ChromeOS. The caller is responsible for constructing a TabGroupVisualData with only the fields they want to change. For example,, see TabStripModel::ChangeTabGroupVisuals() which also takes a TabGroupVisualData parameter.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
const tab_groups::TabGroupVisualData* visual_data = tab_group->visual_data();James CookBefore if a user wanted to just set the title, they would call this method, while keeping the other properties the same (color and is_collopased).
With the new methods, a user will override all the properties. It is the intended behavior?
Yes, this is the way in generally works on Win/Mac/Linux/ChromeOS. The caller is responsible for constructing a TabGroupVisualData with only the fields they want to change. For example,, see TabStripModel::ChangeTabGroupVisuals() which also takes a TabGroupVisualData parameter.
Not a greatest fan, for delegating the responsibility to the user but it is what it is. Thanks for the explanation!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Thanks, Zoraiz! Owners, please take a look:
Calder: //chrome/android and //chrome/browser/ui/android
Mike: //chrome/browser/ui (non-android)
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
@CalledByNativeThese methods already exist in TabCollectionTabModelImpl, the implementation of TabModelJniBridge. I'm just exposing them via JNI.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
LGTM
@CalledByNativeThese methods already exist in TabCollectionTabModelImpl, the implementation of TabModelJniBridge. I'm just exposing them via JNI.
Ack. SGTM
Java_TabModelJniBridge_setTabGroupTitle(env, jobj, group_id.token(),
visual_data.title());
// The cast is safe because the enum values are synced across C++ and Java.
Java_TabModelJniBridge_setTabGroupColor(
env, jobj, group_id.token(), static_cast<jint>(visual_data.color()));
Java_TabModelJniBridge_setTabGroupCollapsed(env, jobj, group_id.token(),
visual_data.is_collapsed(),
/*animate=*/false);Optional: We could bundle these into one JNI method that takes title, color, and collapsed status/animate in one method and also does all the changes together on the TabCollectionTabModelImpl side. It would shave off up to 4 JNI calls which is a perf win and the API will be more aligned with desktop.
I can alternatively do this as a follow-up?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +1 |
Mike, over to you.
Calder, thanks for the review!
Java_TabModelJniBridge_setTabGroupTitle(env, jobj, group_id.token(),
visual_data.title());
// The cast is safe because the enum values are synced across C++ and Java.
Java_TabModelJniBridge_setTabGroupColor(
env, jobj, group_id.token(), static_cast<jint>(visual_data.color()));
Java_TabModelJniBridge_setTabGroupCollapsed(env, jobj, group_id.token(),
visual_data.is_collapsed(),
/*animate=*/false);Optional: We could bundle these into one JNI method that takes title, color, and collapsed status/animate in one method and also does all the changes together on the TabCollectionTabModelImpl side. It would shave off up to 4 JNI calls which is a perf win and the API will be more aligned with desktop.
I can alternatively do this as a follow-up?
If you don't mind taking care of this in a follow-up, one method sounds great. (Frankly, I'm not very experienced with JNI/Java, and I've got a ton of other stuff to do to support this extension API.) Thanks for the offer, and let me know if I can help somehow.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
Java_TabModelJniBridge_setTabGroupTitle(env, jobj, group_id.token(),
visual_data.title());
// The cast is safe because the enum values are synced across C++ and Java.
Java_TabModelJniBridge_setTabGroupColor(
env, jobj, group_id.token(), static_cast<jint>(visual_data.color()));
Java_TabModelJniBridge_setTabGroupCollapsed(env, jobj, group_id.token(),
visual_data.is_collapsed(),
/*animate=*/false);James CookOptional: We could bundle these into one JNI method that takes title, color, and collapsed status/animate in one method and also does all the changes together on the TabCollectionTabModelImpl side. It would shave off up to 4 JNI calls which is a perf win and the API will be more aligned with desktop.
I can alternatively do this as a follow-up?
If you don't mind taking care of this in a follow-up, one method sounds great. (Frankly, I'm not very experienced with JNI/Java, and I've got a ton of other stuff to do to support this extension API.) Thanks for the offer, and let me know if I can help somehow.
@mf...@google.com you mentioned you have spare cycles could you do this?
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Code-Review | +1 |
c/b/ui lgtm
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
| Auto-Submit | +0 |
| Commit-Queue | +2 |
Thanks for the reviews, everyone!
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |
extensions: Tab group API visual data for desktop Android, part 3
Prepare for supporting chrome.tabGroups.update() on desktop Android.
Add TabListInterface::SetTabGroupColor() and SetTabGroupCollapsed().
For Android, use the existing Java implementations of these methods in
TabCollectionTabModelImpl, just expose them via JNI. They are already
well tested in TabCollectionTabModelImplTest.
Extend the TabsGroupApiTest slightly for end-to-end coverage this
interface change.
| Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. |