mac: add "Always Show Full URLs" option to main menus
This provides access via the system menus to a new setting that is
currently only present in the omnibox context menu. To achieve that,
this change:
1) Adds a new IDC_SHOW_FULL_URLS command and handling logic
2) Adds a new conditionally-present item to the main menu bound to
that command
3) Has OmniboxViewView listen for changes in the backing pref and
update its appearance
4) Remove the logic in OmniboxViewView to manually update appearance
when changing the pref, since that is now accomplished via
listening to changes on the pref
This change doesn't have any automated tests. I spent some hours
trying to write one, but ran persistently into two problems:
1) All the existing tests of OmniboxViewView are Views unittests
and do not have a "real" LocationBarView/Browser/PrefService
2) Adding a new test, using BrowserWithTestWindowTest instead,
means having to construct a real LocationBarView and quite
a few other backing services/classes/etc.
The effort involved and brittleness of the resulting test quickly
exceeded the value of the test, so I decided to just do without.
Bug: 1061576
Change-Id: I17d86124e334fb7f85407a16f2c8c31d9f77ebbf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2120854
Commit-Queue: Elly Fong-Jones <[email protected]>
Reviewed-by: Greg Thompson <[email protected]>
Reviewed-by: Robert Sesek <[email protected]>
Reviewed-by: Tommy Li <[email protected]>
Cr-Commit-Position: refs/heads/master@{#755105}
diff --git a/chrome/browser/ui/browser_commands.h b/chrome/browser/ui/browser_commands.h
index d971d121..6b59473 100644
--- a/chrome/browser/ui/browser_commands.h
+++ b/chrome/browser/ui/browser_commands.h
@@ -183,6 +183,7 @@
void OpenTaskManager(Browser* browser);
void OpenFeedbackDialog(Browser* browser, FeedbackSource source);
void ToggleBookmarkBar(Browser* browser);
+void ToggleShowFullURLs(Browser* browser);
void ShowAppMenu(Browser* browser);
void ShowAvatarMenu(Browser* browser);
void OpenUpdateChromeDialog(Browser* browser);