Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(81)

Unified Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 2692913003: Move save/generate password options to the top of the context menu (Closed)
Patch Set: Revert generated_resources.grd Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/renderer_context_menu/render_view_context_menu.cc
diff --git a/chrome/browser/renderer_context_menu/render_view_context_menu.cc b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
index 92d96ddcd3a83843783193e3426a11caa0c57e4b..9fd0269f14ee250d174405ee15e30fb5b9294a1d 100644
--- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
+++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
@@ -1467,17 +1467,20 @@ void RenderViewContextMenu::AppendProtocolHandlerSubMenu() {
void RenderViewContextMenu::AppendPasswordItems() {
bool separator_added = false;
+ int menu_position = 0;
if (password_manager::ForceSavingExperimentEnabled()) {
- menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
+ menu_model_.InsertItemWithStringIdAt(menu_position,
lazyboy 2017/02/14 19:26:41 instead of using mix of menu_position, ++menu_posi
edwardjung 2017/02/14 20:17:21 Of course. yes this is much simpler and removes th
+ IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD,
+ IDS_CONTENT_CONTEXT_FORCESAVEPASSWORD);
+ menu_model_.InsertSeparatorAt(++menu_position, ui::NORMAL_SEPARATOR);
separator_added = true;
- menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD,
- IDS_CONTENT_CONTEXT_FORCESAVEPASSWORD);
}
if (password_manager::ManualPasswordGenerationEnabled()) {
+ menu_model_.InsertItemWithStringIdAt(menu_position,
+ IDC_CONTENT_CONTEXT_GENERATEPASSWORD,
+ IDS_CONTENT_CONTEXT_GENERATEPASSWORD);
if (!separator_added)
- menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
- menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_GENERATEPASSWORD,
- IDS_CONTENT_CONTEXT_GENERATEPASSWORD);
+ menu_model_.InsertSeparatorAt(menu_position + 1, ui::NORMAL_SEPARATOR);
}
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698