Skip to content

Commit

Permalink
Remove contextual 'Open in Sidebar' menu
Browse files Browse the repository at this point in the history
Now, extensions define themselves if open as normal popup or as sidebar.
  • Loading branch information
ltilve committed May 4, 2015
1 parent 0ccf0eb commit 3a0650b
Show file tree
Hide file tree
Showing 7 changed files with 1 addition and 30 deletions.
6 changes: 0 additions & 6 deletions chrome/app/generated_resources.grd
Original file line number Diff line number Diff line change
Expand Up @@ -4978,9 +4978,6 @@ Even if you have downloaded files from this website before, the website might ha
<message name="IDS_MANAGE_EXTENSION" desc="The 'Manage extensions' text in the context menu for when right-clicking on extension icons (sentence case).">
Manage extensions
</message>
<message name="IDS_USE_SIDEBAR" desc="The 'Manage extensions' text in the context menu for when right-clicking on extension icons (sentence case).">
Open in sidebar
</message>
<message name="IDS_EXTENSION_ACTION_INSPECT_POPUP" desc="The text for the right-click menu of page and browser actions which shows the popup and opens the developer tools (sentence case).">
Inspect popup
</message>
Expand All @@ -4998,9 +4995,6 @@ Even if you have downloaded files from this website before, the website might ha
<message name="IDS_EXTENSIONS_HIDE_BUTTON" desc="The text for the Hide context menu item (title case).">
Hide Button
</message>
<message name="IDS_USE_SIDEBAR" desc="The 'Manage extensions' text in the context menu for when right-clicking on extension icons (sentence case).">
Open in sidebar
</message>
<message name="IDS_MANAGE_EXTENSION" desc="The 'Manage Extensions' text in the context menu for when right-clicking on extension icons (title case).">
Manage Extensions
</message>
Expand Down
11 changes: 0 additions & 11 deletions chrome/browser/extensions/extension_context_menu_model.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ ExtensionContextMenuModel::ExtensionContextMenuModel(const Extension* extension,
}

bool ExtensionContextMenuModel::IsCommandIdChecked(int command_id) const {
if (command_id == SIDEBAR) {
return profile_->GetPrefs()->GetBoolean(prefs::kShowPopupInSidebar);
}
if (command_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST &&
command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST)
return extension_items_->IsCommandIdChecked(command_id);
Expand All @@ -144,8 +141,6 @@ bool ExtensionContextMenuModel::IsCommandIdEnabled(int command_id) const {
if (command_id >= IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST &&
command_id <= IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST) {
return extension_items_->IsCommandIdEnabled(command_id);
} else if (command_id == SIDEBAR) {
return true;
} else if (command_id == CONFIGURE) {
return extensions::OptionsPageInfo::HasOptionsPage(extension);
} else if (command_id == NAME) {
Expand Down Expand Up @@ -206,11 +201,6 @@ void ExtensionContextMenuModel::ExecuteCommand(int command_id,
}
break;
}
case SIDEBAR: {
bool current = profile_->GetPrefs()->GetBoolean(prefs::kShowPopupInSidebar);
profile_->GetPrefs()->SetBoolean(prefs::kShowPopupInSidebar, !current);
}
break;
case CONFIGURE:
DCHECK(extensions::OptionsPageInfo::HasOptionsPage(extension));
extensions::ExtensionTabUtil::OpenOptionsPage(extension, browser_);
Expand Down Expand Up @@ -298,7 +288,6 @@ void ExtensionContextMenuModel::InitMenu(const Extension* extension) {
->WantsToRun(extension)) {
AddItemWithStringId(ALWAYS_RUN, IDS_EXTENSIONS_ALWAYS_RUN);
}
AddCheckItem(SIDEBAR, l10n_util::GetStringUTF16(IDS_USE_SIDEBAR));
AddItemWithStringId(CONFIGURE, IDS_EXTENSIONS_OPTIONS_MENU_ITEM);
AddItem(UNINSTALL, l10n_util::GetStringUTF16(IDS_EXTENSIONS_UNINSTALL));

Expand Down
1 change: 0 additions & 1 deletion chrome/browser/extensions/extension_context_menu_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class ExtensionContextMenuModel
enum MenuEntries {
NAME = 0,
CONFIGURE,
SIDEBAR,
TOGGLE_VISIBILITY,
UNINSTALL,
MANAGE,
Expand Down
4 changes: 0 additions & 4 deletions chrome/browser/ui/browser_ui_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,6 @@ void RegisterBrowserUserPrefs(user_prefs::PrefRegistrySyncable* registry) {
prefs::kShowHomeButton,
false,
user_prefs::PrefRegistrySyncable::SYNCABLE_PREF);
registry->RegisterBooleanPref(
prefs::kShowPopupInSidebar,
false,
user_prefs::PrefRegistrySyncable::UNSYNCABLE_PREF);
#if defined(OS_MACOSX)
// This really belongs in platform code, but there's no good place to
// initialize it between the time when the AppController is created
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -288,9 +288,7 @@ bool ExtensionActionViewController::ShowPopupWithUrl(
if (already_showing)
return false;

bool use_sidebar =
browser()->profile()->GetPrefs()->GetBoolean(prefs::kShowPopupInSidebar) ||
extension_action_->open_in_sidebar();
bool use_sidebar = extension_action_->open_in_sidebar();

if (use_sidebar) {
SidebarManager* sidebar_manager = SidebarManager::GetInstance();
Expand Down
4 changes: 0 additions & 4 deletions chrome/common/pref_names.cc
Original file line number Diff line number Diff line change
Expand Up @@ -836,10 +836,6 @@ const char kIpcDisabledMessages[] = "ipc_log_disabled_messages";
// visible on the toolbar.
const char kShowHomeButton[] = "browser.show_home_button";

// A boolean pref set to true if an extension popup to open the pages should be
// visible in the sidebar.
const char kShowPopupInSidebar[] = "browser.show_home_popup_in_sidebar";

// A string value which saves short list of recently user selected encodings
// separated with comma punctuation mark.
const char kRecentlySelectedEncoding[] = "profile.recently_selected_encodings";
Expand Down
1 change: 0 additions & 1 deletion chrome/common/pref_names.h
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ extern const char kForceMaximizeOnFirstRun[];
#endif // defined(OS_CHROMEOS)
extern const char kIpcDisabledMessages[];
extern const char kShowHomeButton[];
extern const char kShowPopupInSidebar[];
extern const char kRecentlySelectedEncoding[];
extern const char kDeleteBrowsingHistory[];
extern const char kDeleteDownloadHistory[];
Expand Down

0 comments on commit 3a0650b

Please sign in to comment.