cef/patch/patches/chrome_browser_profile_menu...

76 lines
4.0 KiB
Diff

diff --git chrome/browser/ui/bookmarks/bookmark_stats.cc chrome/browser/ui/bookmarks/bookmark_stats.cc
index 1f928081c142d..697914a83b3c4 100644
--- chrome/browser/ui/bookmarks/bookmark_stats.cc
+++ chrome/browser/ui/bookmarks/bookmark_stats.cc
@@ -21,7 +21,9 @@ bool IsBookmarkBarLocation(BookmarkLaunchLocation location) {
auto GetMetricProfile(const Profile* profile) {
DCHECK(profile);
- DCHECK(profile->IsRegularProfile() || profile->IsIncognitoProfile());
+ DCHECK(profile->IsRegularProfile() || profile->IsIncognitoProfile() ||
+ (profile->IsOffTheRecord() &&
+ profile->GetOTRProfileID().IsUniqueForCEF()));
return profile->IsRegularProfile()
? profile_metrics::BrowserProfileType::kRegular
: profile_metrics::BrowserProfileType::kIncognito;
diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
index 62d33747b6c3f..4b8a512d1ca85 100644
--- chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
+++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
@@ -29,7 +29,9 @@ IncognitoClearBrowsingDataDialog::IncognitoClearBrowsingDataDialog(
dialog_type_(type),
incognito_profile_(incognito_profile) {
DCHECK(incognito_profile_);
- DCHECK(incognito_profile_->IsIncognitoProfile());
+ DCHECK(incognito_profile_->IsIncognitoProfile() ||
+ (incognito_profile_->IsOffTheRecord() &&
+ incognito_profile_->GetOTRProfileID().IsUniqueForCEF()));
SetButtons(ui::DIALOG_BUTTON_NONE);
SetShowCloseButton(true);
diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc
index 10c69e08d9e41..847dc896eca41 100644
--- chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc
+++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog_coordinator.cc
@@ -26,6 +26,10 @@ void IncognitoClearBrowsingDataDialogCoordinator::Show(
->toolbar_button_provider()
->GetAvatarToolbarButton();
+ // The full toolbar may not be visible.
+ if (!avatar_toolbar_button)
+ return;
+
auto bubble = std::make_unique<IncognitoClearBrowsingDataDialog>(
avatar_toolbar_button, GetBrowser().profile(), type);
DCHECK_EQ(nullptr, bubble_tracker_.view());
diff --git chrome/browser/ui/views/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc
index 34949452d4891..43aa445b5ac3f 100644
--- chrome/browser/ui/views/profiles/incognito_menu_view.cc
+++ chrome/browser/ui/views/profiles/incognito_menu_view.cc
@@ -37,7 +37,9 @@
IncognitoMenuView::IncognitoMenuView(views::Button* anchor_button,
Browser* browser)
: ProfileMenuViewBase(anchor_button, browser) {
- DCHECK(browser->profile()->IsIncognitoProfile());
+ DCHECK(browser->profile()->IsIncognitoProfile() ||
+ (browser->profile()->IsOffTheRecord() &&
+ browser->profile()->GetOTRProfileID().IsUniqueForCEF()));
GetViewAccessibility().OverrideName(GetAccessibleWindowTitle());
base::RecordAction(base::UserMetricsAction("IncognitoMenu_Show"));
diff --git chrome/browser/ui/views/profiles/profile_menu_coordinator.cc chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
index 78c840b6fe442..7c694b9e8d754 100644
--- chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
+++ chrome/browser/ui/views/profiles/profile_menu_coordinator.cc
@@ -44,7 +44,9 @@ void ProfileMenuCoordinator::Show(bool is_source_accelerator) {
feature_engagement::kIPHProfileSwitchFeature);
std::unique_ptr<ProfileMenuViewBase> bubble;
- if (browser.profile()->IsIncognitoProfile()) {
+ if (browser.profile()->IsIncognitoProfile() ||
+ (browser.profile()->IsOffTheRecord() &&
+ browser.profile()->GetOTRProfileID().IsUniqueForCEF())) {
bubble =
std::make_unique<IncognitoMenuView>(avatar_toolbar_button, &browser);
} else {