Chromium Code Reviews| Index: chrome/browser/ui/webui/set_as_default_browser_ui.cc |
| diff --git a/chrome/browser/ui/webui/set_as_default_browser_ui.cc b/chrome/browser/ui/webui/set_as_default_browser_ui.cc |
| index a9a6a9e2c79bc0e7310a1616e930e29c2dee3bc0..ad2edbdb2ce0275107a50cadf8f23513675be068 100644 |
| --- a/chrome/browser/ui/webui/set_as_default_browser_ui.cc |
| +++ b/chrome/browser/ui/webui/set_as_default_browser_ui.cc |
| @@ -42,7 +42,6 @@ |
| #include "ui/base/l10n/l10n_font_util.h" |
| #include "ui/base/l10n/l10n_util.h" |
| #include "ui/gfx/font.h" |
| -#include "ui/views/widget/widget.h" |
| #include "ui/web_dialogs/web_dialog_delegate.h" |
| using content::BrowserThread; |
| @@ -53,6 +52,8 @@ namespace { |
| const char kSetAsDefaultBrowserHistogram[] = "DefaultBrowser.InteractionResult"; |
| +views::Widget* g_dialog_widget; |
|
grt (UTC plus 2)
2016/07/13 08:54:49
if you must use a global variable (i see you're di
zmin
2016/07/18 21:12:14
Done.
|
| + |
| // The enum permits registering in UMA the three possible outcomes (do not |
| // reorder these). |
| // ACCEPTED: user pressed Next and made Chrome default. |
| @@ -246,9 +247,8 @@ void SetAsDefaultBrowserDialogImpl::ShowDialog() { |
| // in the Windows task bar. The code below will make it highlight if the |
| // dialog is not in the foreground. |
| gfx::NativeWindow native_window = chrome::ShowWebDialog(NULL, profile_, this); |
| - views::Widget* widget = views::Widget::GetWidgetForNativeWindow( |
| - native_window); |
| - widget->FlashFrame(true); |
| + g_dialog_widget = views::Widget::GetWidgetForNativeWindow(native_window); |
| + g_dialog_widget->FlashFrame(true); |
| } |
| ui::ModalType SetAsDefaultBrowserDialogImpl::GetDialogModalType() const { |
| @@ -352,3 +352,8 @@ void SetAsDefaultBrowserUI::Show(Profile* profile, Browser* browser) { |
| new SetAsDefaultBrowserDialogImpl(profile, browser); |
| dialog->ShowDialog(); |
| } |
| + |
| +// static |
| +views::Widget* SetAsDefaultBrowserUI::GetDialogWidgetForTesting() { |
| + return g_dialog_widget; |
| +} |