Skip to content

Commit

Permalink
[118] Bookmarks++: Add bookmarks manager menu item
Browse files Browse the repository at this point in the history
Also adds new menu icons, and adds side panel menu item to metrics

(cherry picked from commit a074cf0)

Low-Coverage-Reason: TRIVIAL_CHANGE
Bug: 1485954
Change-Id: I2b2a95143bd7f64a8a0cc1e386047e14b1bc8eff
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4903181
Reviewed-by: Scott Violet <sky@chromium.org>
Commit-Queue: Emily Shack <emshack@chromium.org>
Cr-Original-Commit-Position: refs/heads/main@{#1203458}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4907721
Auto-Submit: Emily Shack <emshack@chromium.org>
Cr-Commit-Position: refs/branch-heads/5993@{#1071}
Cr-Branched-From: 5113507-refs/heads/main@{#1192594}
  • Loading branch information
Emily Shack authored and Chromium LUCI CQ committed Oct 2, 2023
1 parent 71e6f0c commit 60a4a84
Show file tree
Hide file tree
Showing 8 changed files with 125 additions and 5 deletions.
2 changes: 2 additions & 0 deletions chrome/app/vector_icons/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ aggregate_vector_icons("chrome_vector_icons") {
"bookmarkbar_touch_overflow.icon",
"bookmarks_chrome_refresh.icon",
"bookmarks_lists_menu.icon",
"bookmarks_manager.icon",
"bookmarks_side_panel.icon",
"browser_logo.icon",
"browser_tools.icon",
"browser_tools_chrome_refresh.icon",
Expand Down
65 changes: 65 additions & 0 deletions chrome/app/vector_icons/bookmarks_manager.icon
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

CANVAS_DIMENSIONS, 20,
MOVE_TO, 3.6f, 14.4f,
V_LINE_TO, 5.6f,
V_LINE_TO, 14.4f,
CLOSE,
MOVE_TO, 3.6f, 16.2f,
R_CUBIC_TO, -0.5f, 0, -0.9f, -0.2f, -1.2f, -0.5f,
R_CUBIC_TO, -0.3f, -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_LINE_TO, -4.4f, 4.4f,
CUBIC_TO, 14.5f, 18.2f, 12, 18.2f, 12, 18.2f,
CLOSE,
MOVE_TO, 18.1f, 13,
R_LINE_TO, -0.9f, -0.9f,
LINE_TO, 18.1f, 13,
CLOSE,
MOVE_TO, 13.1f, 17.1f,
H_LINE_TO, 14,
R_LINE_TO, 2.4f, -2.4f,
R_LINE_TO, -0.5f, -0.5f,
R_LINE_TO, -0.5f, -0.5f,
R_LINE_TO, -2.4f, 2.4f,
V_LINE_TO, 17.1f,
CLOSE,
MOVE_TO, 15.9f, 14.2f,
R_LINE_TO, -0.5f, -0.5f,
R_LINE_TO, 0.9f, 0.9f,
LINE_TO, 15.9f, 14.2f,
CLOSE
43 changes: 43 additions & 0 deletions chrome/app/vector_icons/bookmarks_side_panel.icon
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

CANVAS_DIMENSIONS, 20,
MOVE_TO, 14, 12.9f,
R_LINE_TO, 3, -2.6f,
R_LINE_TO, 2.5f, 0.2f,
LINE_TO, 16, 13.6f,
R_LINE_TO, 1.1f, 4.6f,
LINE_TO, 15, 17,
CUBIC_TO, 15, 17, 14, 12.9f, 14, 12.9f,
CLOSE,
MOVE_TO, 12.1f, 7,
R_LINE_TO, -0.9f, -2,
R_LINE_TO, 1.1f, -2.5f,
R_LINE_TO, 2, 4.6f,
LINE_TO, 12.1f, 7,
CLOSE,
MOVE_TO, 6.4f, 14.8f,
LINE_TO, 9, 13.2f,
R_LINE_TO, 2.6f, 1.5f,
R_LINE_TO, -0.7f, -2.9f,
R_LINE_TO, 2.2f, -1.9f,
R_LINE_TO, -3, -0.3f,
LINE_TO, 9, 7,
LINE_TO, 7.8f, 9.7f,
R_LINE_TO, -3, 0.3f,
R_LINE_TO, 2.3f, 1.9f,
CUBIC_TO, 7.1f, 11.9f, 6.4f, 14.8f, 6.4f, 14.8f,
CLOSE,
MOVE_TO, 3.8f, 18.3f,
R_LINE_TO, 1.4f, -5.8f,
LINE_TO, 0.6f, 8.6f,
R_LINE_TO, 6, -0.5f,
LINE_TO, 9, 2.6f,
R_LINE_TO, 2.4f, 5.5f,
R_LINE_TO, 6, 0.5f,
R_LINE_TO, -4.6f, 3.9f,
R_LINE_TO, 1.4f, 5.8f,
LINE_TO, 9, 15.3f,
LINE_TO, 3.8f, 18.3f,
CLOSE
7 changes: 7 additions & 0 deletions chrome/browser/ui/toolbar/app_menu_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -878,6 +878,13 @@ void AppMenuModel::LogMenuMetrics(int command_id) {
}
LogMenuAction(MENU_ACTION_SHOW_BOOKMARK_BAR);
break;
case IDC_SHOW_BOOKMARK_SIDE_PANEL:
if (!uma_action_recorded_) {
UMA_HISTOGRAM_MEDIUM_TIMES(
"WrenchMenu.TimeToAction.ShowBookmarkSidePanel", delta);
}
LogMenuAction(MENU_ACTION_SHOW_BOOKMARK_SIDE_PANEL);
break;
case IDC_SHOW_BOOKMARK_MANAGER:
if (!uma_action_recorded_) {
UMA_HISTOGRAM_MEDIUM_TIMES("WrenchMenu.TimeToAction.ShowBookmarkMgr",
Expand Down
1 change: 1 addition & 0 deletions chrome/browser/ui/toolbar/app_menu_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ enum AppMenuAction {
MENU_ACTION_SHOW_ADDRESSES = 79,
MENU_ACTION_SWITCH_TO_ANOTHER_PROFILE = 80,
MENU_ACTION_SHOW_SEARCH_COMPANION = 81,
MENU_ACTION_SHOW_BOOKMARK_SIDE_PANEL = 82,

LIMIT_MENU_ACTION
};
Expand Down
10 changes: 5 additions & 5 deletions chrome/browser/ui/toolbar/bookmark_sub_menu_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,8 @@ void BookmarkSubMenuModel::Build(Browser* browser) {
if (features::IsChromeRefresh2023()) {
AddItemWithStringId(IDC_SHOW_BOOKMARK_SIDE_PANEL,
IDS_SHOW_BOOKMARK_SIDE_PANEL);
} else {
AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER);
}
AddItemWithStringId(IDC_SHOW_BOOKMARK_MANAGER, IDS_BOOKMARK_MANAGER);

#if !BUILDFLAG(IS_CHROMEOS_ASH)
AddItemWithStringId(IDC_IMPORT_SETTINGS, IDS_IMPORT_SETTINGS_MENU_LABEL);
Expand All @@ -74,15 +73,16 @@ void BookmarkSubMenuModel::Build(Browser* browser) {
auto set_icon = [this](int command_id, const gfx::VectorIcon& vector_icon) {
auto index = GetIndexOfCommandId(command_id);
if (index) {
SetIcon(index.value(), ui::ImageModel::FromVectorIcon(vector_icon));
SetIcon(index.value(),
ui::ImageModel::FromVectorIcon(vector_icon, ui::kColorMenuIcon, 16));
}
};

set_icon(IDC_BOOKMARK_THIS_TAB, kBookmarksListsMenuIcon);
set_icon(IDC_BOOKMARK_ALL_TABS, kBookmarkAllTabsChromeRefreshIcon);
set_icon(IDC_SHOW_BOOKMARK_BAR, kToolbarChromeRefreshIcon);
set_icon(IDC_SHOW_BOOKMARK_MANAGER, kBookmarksChromeRefreshIcon);
set_icon(IDC_SHOW_BOOKMARK_SIDE_PANEL, kBookmarksChromeRefreshIcon);
set_icon(IDC_SHOW_BOOKMARK_MANAGER, kBookmarksManagerIcon);
set_icon(IDC_SHOW_BOOKMARK_SIDE_PANEL, kBookmarksSidePanelIcon);
set_icon(IDC_IMPORT_SETTINGS, kMenuBookChromeRefreshIcon);
}
}
1 change: 1 addition & 0 deletions tools/metrics/histograms/enums.xml
Original file line number Diff line number Diff line change
Expand Up @@ -117434,6 +117434,7 @@ Called by update_scheduler_enums.py.-->
<int value="79" label="Addresses and more"/>
<int value="80" label="Switch directly to other profile"/>
<int value="81" label="Show search companion"/>
<int value="82" label="Show bookmark side panel"/>
</enum>

<enum name="WrongConfigurationMetric">
Expand Down
1 change: 1 addition & 0 deletions tools/metrics/histograms/metadata/others/histograms.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14619,6 +14619,7 @@ regressions. -->
<variant name="ShowAddresses"/>
<variant name="ShowBookmarkBar"/>
<variant name="ShowBookmarkMgr"/>
<variant name="ShowBookmarkSidePanel"/>
<variant name="ShowChromeLabs"/>
<variant name="ShowDownloads"/>
<variant name="ShowHistory"/>
Expand Down

0 comments on commit 60a4a84

Please sign in to comment.