Skip to content

Commit

Permalink
[Lens]Add translate onebox entrypoint
Browse files Browse the repository at this point in the history
Bug: b/295927287
Change-Id: Iaf425359288b25b6ed7a0be3e95483ffc7354f05
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4804823
Reviewed-by: Sylvain Defresne <sdefresne@chromium.org>
Commit-Queue: Jason Hu <hujasonx@google.com>
Cr-Commit-Position: refs/heads/main@{#1187312}
  • Loading branch information
hujasonx authored and Chromium LUCI CQ committed Aug 23, 2023
1 parent 4afa360 commit 228c8a1
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,8 @@ public class LensMetrics {
AmbientSearchEntryPoint.QUICK_ACTION_SEARCH_WIDGET, AmbientSearchEntryPoint.KEYBOARD,
AmbientSearchEntryPoint.SPOTLIGHT, AmbientSearchEntryPoint.APP_ICON_LONG_PRESS,
AmbientSearchEntryPoint.PLUS_BUTTON, AmbientSearchEntryPoint.WEB_SEARCH_BAR,
AmbientSearchEntryPoint.NUM_ENTRIES})
AmbientSearchEntryPoint.COMPANION_REGION_SEARCH,
AmbientSearchEntryPoint.TRANSLATE_ONEBOX, AmbientSearchEntryPoint.NUM_ENTRIES})
@Retention(RetentionPolicy.SOURCE)
public static @interface AmbientSearchEntryPoint {
int CONTEXT_MENU_SEARCH_IMAGE_WITH_GOOGLE_LENS = 0;
Expand All @@ -76,7 +77,9 @@ public class LensMetrics {
int APP_ICON_LONG_PRESS = 10;
int PLUS_BUTTON = 11;
int WEB_SEARCH_BAR = 12;
int NUM_ENTRIES = 13;
int COMPANION_REGION_SEARCH = 13;
int TRANSLATE_ONEBOX = 14;
int NUM_ENTRIES = 15;
}

// Note: These values must match the CameraOpenEntryPoint enum in enums.xml.
Expand All @@ -85,7 +88,8 @@ public class LensMetrics {
CameraOpenEntryPoint.QUICK_ACTION_SEARCH_WIDGET, CameraOpenEntryPoint.TASKS_SURFACE,
CameraOpenEntryPoint.KEYBOARD, CameraOpenEntryPoint.SPOTLIGHT,
CameraOpenEntryPoint.APP_ICON_LONG_PRESS, CameraOpenEntryPoint.PLUS_BUTTON,
CameraOpenEntryPoint.WEB_SEARCH_BAR, CameraOpenEntryPoint.NUM_ENTRIES})
CameraOpenEntryPoint.WEB_SEARCH_BAR, CameraOpenEntryPoint.TRANSLATE_ONEBOX,
CameraOpenEntryPoint.NUM_ENTRIES})
@Retention(RetentionPolicy.SOURCE)
public static @interface CameraOpenEntryPoint {
int OMNIBOX = 0;
Expand All @@ -97,7 +101,8 @@ public class LensMetrics {
int APP_ICON_LONG_PRESS = 6;
int PLUS_BUTTON = 7;
int WEB_SEARCH_BAR = 8;
int NUM_ENTRIES = 9;
int TRANSLATE_ONEBOX = 9;
int NUM_ENTRIES = 10;
}

/**
Expand Down
3 changes: 2 additions & 1 deletion components/lens/lens_metrics.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ enum class AmbientSearchEntryPoint {
PLUS_BUTTON = 11,
WEB_SEARCH_BAR = 12,
COMPANION_REGION_SEARCH = 13,
kMaxValue = COMPANION_REGION_SEARCH
TRANSLATE_ONEBOX = 14,
kMaxValue = TRANSLATE_ONEBOX
};

// This should be kept in sync with the LensRegionSearchAspectRatio enum
Expand Down
3 changes: 2 additions & 1 deletion ios/chrome/browser/ui/lens/lens_entrypoint.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ enum class LensEntrypoint {
AppIconLongPress = 7,
PlusButton = 8,
WebSearchBar = 9,
kMaxValue = WebSearchBar,
TranslateOnebox = 10,
kMaxValue = TranslateOnebox,
};

extern const char kIOSLensEntrypoint[];
Expand Down
3 changes: 3 additions & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -1907,6 +1907,7 @@ Unknown properties are collapsed to zero. -->
<int value="11" label="Plus Button (Camera)"/>
<int value="12" label="Web Search Bar (Camera)"/>
<int value="13" label="Companion (Region)"/>
<int value="14" label="Translate Onebox (Camera)"/>
</enum>

<enum name="AmbientUiMode">
Expand Down Expand Up @@ -14222,6 +14223,7 @@ Called by update_bad_message_reasons.py.-->
<int value="6" label="App Icon Long Press"/>
<int value="7" label="Plus Button"/>
<int value="8" label="Web Search Bar"/>
<int value="9" label="Translate Onebox"/>
</enum>

<enum name="CameraPreviewSnapPosition">
Expand Down Expand Up @@ -55633,6 +55635,7 @@ Unsupported non-ascii characters will cause issues with xml presubmits.
plus button.
</int>
<int value="9" label="Web Search Bar"/>
<int value="10" label="Translate Onebox"/>
</enum>

<enum name="IOSLensSupportStatus">
Expand Down

0 comments on commit 228c8a1

Please sign in to comment.