Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use last opened panel when selecting sidepanel button in toolbar #16822

Merged
merged 1 commit into from
Jan 24, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,14 @@ absl::optional<SidePanelEntry::Id> GetDefaultEntryId(Profile* profile) {

// Choose Brave's own default, and exclude items that user has removed
// from sidebar. If none are enabled, do nothing.
#define BRAVE_SIDE_PANEL_COORDINATOR_SHOW \
if (!entry_id.has_value()) { \
entry_id = GetDefaultEntryId(browser_view_->GetProfile()); \
if (!entry_id.has_value()) \
return; \
#define BRAVE_SIDE_PANEL_COORDINATOR_SHOW \
if (!entry_id.has_value()) { \
auto last_active_entry = GetLastActiveEntryKey(); \
entry_id = last_active_entry.has_value() \
? last_active_entry.value().id() \
: GetDefaultEntryId(browser_view_->GetProfile()); \
if (!entry_id.has_value()) \
return; \
}

#include "src/chrome/browser/ui/views/side_panel/side_panel_coordinator.cc"
Expand Down