71 lines
3.7 KiB
Diff
71 lines
3.7 KiB
Diff
diff --git chrome/browser/profiles/profile_window.cc chrome/browser/profiles/profile_window.cc
|
|
index fdc911e5aeb83..724ef4429f14f 100644
|
|
--- chrome/browser/profiles/profile_window.cc
|
|
+++ chrome/browser/profiles/profile_window.cc
|
|
@@ -282,7 +282,9 @@ void BubbleViewModeFromAvatarBubbleMode(BrowserWindow::AvatarBubbleMode mode,
|
|
*bubble_view_mode = BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
|
|
return;
|
|
case BrowserWindow::AVATAR_BUBBLE_MODE_DEFAULT:
|
|
- *bubble_view_mode = profile->IsIncognitoProfile()
|
|
+ *bubble_view_mode = profile->IsIncognitoProfile() ||
|
|
+ (profile->IsOffTheRecord() &&
|
|
+ profile->GetOTRProfileID().IsUniqueForCEF())
|
|
? profiles::BUBBLE_VIEW_MODE_INCOGNITO
|
|
: profiles::BUBBLE_VIEW_MODE_PROFILE_CHOOSER;
|
|
}
|
|
diff --git chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
|
|
index 4569d0afcb80a..5af2fb12f1d7a 100644
|
|
--- chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
|
|
+++ chrome/browser/ui/views/incognito_clear_browsing_data_dialog.cc
|
|
@@ -30,6 +30,9 @@ IncognitoClearBrowsingDataDialog* g_incognito_cbd_dialog = nullptr;
|
|
void IncognitoClearBrowsingDataDialog::Show(views::View* anchor_view,
|
|
Profile* incognito_profile,
|
|
Type type) {
|
|
+ // The full toolbar may not be visible.
|
|
+ if (!anchor_view)
|
|
+ return;
|
|
g_incognito_cbd_dialog = new IncognitoClearBrowsingDataDialog(
|
|
anchor_view, incognito_profile, type);
|
|
views::Widget* const widget =
|
|
@@ -72,7 +75,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/profiles/incognito_menu_view.cc chrome/browser/ui/views/profiles/incognito_menu_view.cc
|
|
index 9c0ed63b74ca8..b9e7bcbcfd605 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());
|
|
|
|
chrome::RecordDialogCreation(
|
|
diff --git chrome/browser/ui/views/profiles/profile_menu_view_base.cc chrome/browser/ui/views/profiles/profile_menu_view_base.cc
|
|
index 1a6a648e63e31..dc1316b9fb227 100644
|
|
--- chrome/browser/ui/views/profiles/profile_menu_view_base.cc
|
|
+++ chrome/browser/ui/views/profiles/profile_menu_view_base.cc
|
|
@@ -512,7 +512,9 @@ void ProfileMenuViewBase::ShowBubble(profiles::BubbleViewMode view_mode,
|
|
|
|
ProfileMenuViewBase* bubble = nullptr;
|
|
if (view_mode == profiles::BUBBLE_VIEW_MODE_INCOGNITO) {
|
|
- DCHECK(browser->profile()->IsIncognitoProfile());
|
|
+ DCHECK(browser->profile()->IsIncognitoProfile() ||
|
|
+ (browser->profile()->IsOffTheRecord() &&
|
|
+ browser->profile()->GetOTRProfileID().IsUniqueForCEF()));
|
|
bubble = new IncognitoMenuView(anchor_button, browser);
|
|
} else {
|
|
#if BUILDFLAG(IS_CHROMEOS_ASH)
|