Chromium Code Reviews| Index: chrome/browser/ui/views/native_widget_factory.cc |
| diff --git a/chrome/browser/ui/views/native_widget_factory.cc b/chrome/browser/ui/views/native_widget_factory.cc |
| index 722d8de4e9a84033dbb08a3aa92d1c2ed15283a1..3b73127aee34d2b79e29540fcf8615cd28a4782f 100644 |
| --- a/chrome/browser/ui/views/native_widget_factory.cc |
| +++ b/chrome/browser/ui/views/native_widget_factory.cc |
| @@ -42,6 +42,9 @@ views::NativeWidget* CreateNativeWidget( |
| window = native_widget_aura->GetNativeWindow(); |
| native_widget = native_widget_aura; |
| } |
| - SetThemeProfileForWindow(window, profile); |
| + // Use the original profile because |window| may outlive the profile |
| + // of the context window. This can happen with incognito profiles. |
| + // However, the original profile will stick around until shutdown. |
| + SetThemeProfileForWindow(window, profile->GetOriginalProfile()); |
|
sky
2017/05/04 23:24:09
I think it's worth a comment that BrowserView rese
Tom (Use chromium acct)
2017/05/09 05:12:26
Done.
|
| return native_widget; |
| } |