| 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..c2f9143c2ffbb612dd88bc9437771c82b99deb77 100644
|
| --- a/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
| +++ b/chrome/browser/renderer_context_menu/render_view_context_menu.cc
|
| @@ -746,6 +746,11 @@ void RenderViewContextMenu::AppendCurrentExtensionItems() {
|
| void RenderViewContextMenu::InitMenu() {
|
| RenderViewContextMenuBase::InitMenu();
|
|
|
| + if (content_type_->SupportsGroup(
|
| + ContextMenuContentType::ITEM_GROUP_PASSWORD)) {
|
| + AppendPasswordItems();
|
| + }
|
| +
|
| if (content_type_->SupportsGroup(ContextMenuContentType::ITEM_GROUP_PAGE))
|
| AppendPageItems();
|
|
|
| @@ -849,11 +854,6 @@ void RenderViewContextMenu::InitMenu() {
|
| ContextMenuContentType::ITEM_GROUP_PRINT_PREVIEW)) {
|
| AppendPrintPreviewItems();
|
| }
|
| -
|
| - if (content_type_->SupportsGroup(
|
| - ContextMenuContentType::ITEM_GROUP_PASSWORD)) {
|
| - AppendPasswordItems();
|
| - }
|
| }
|
|
|
| Profile* RenderViewContextMenu::GetProfile() {
|
| @@ -1466,19 +1466,19 @@ void RenderViewContextMenu::AppendProtocolHandlerSubMenu() {
|
| }
|
|
|
| void RenderViewContextMenu::AppendPasswordItems() {
|
| - bool separator_added = false;
|
| + bool add_separator = false;
|
| if (password_manager::ForceSavingExperimentEnabled()) {
|
| - menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
|
| - separator_added = true;
|
| menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_FORCESAVEPASSWORD,
|
| IDS_CONTENT_CONTEXT_FORCESAVEPASSWORD);
|
| + add_separator = true;
|
| }
|
| if (password_manager::ManualPasswordGenerationEnabled()) {
|
| - if (!separator_added)
|
| - menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
|
| menu_model_.AddItemWithStringId(IDC_CONTENT_CONTEXT_GENERATEPASSWORD,
|
| IDS_CONTENT_CONTEXT_GENERATEPASSWORD);
|
| + add_separator = true;
|
| }
|
| + if (add_separator)
|
| + menu_model_.AddSeparator(ui::NORMAL_SEPARATOR);
|
| }
|
|
|
| // Menu delegate functions -----------------------------------------------------
|
|
|