| Index: chrome/browser/ui/startup/default_browser_prompt_win.cc
|
| diff --git a/chrome/browser/ui/startup/default_browser_prompt_win.cc b/chrome/browser/ui/startup/default_browser_prompt_win.cc
|
| index 04c9cd3d42368543ae8b1f718e6bbeb7189593ff..a3b2038c95311ff68e44a1f6e422a0483d7bc9d0 100644
|
| --- a/chrome/browser/ui/startup/default_browser_prompt_win.cc
|
| +++ b/chrome/browser/ui/startup/default_browser_prompt_win.cc
|
| @@ -4,70 +4,10 @@
|
|
|
| #include "chrome/browser/ui/startup/default_browser_prompt.h"
|
|
|
| -#include "base/macros.h"
|
| #include "base/win/windows_version.h"
|
| -#include "chrome/browser/profiles/profile.h"
|
| #include "chrome/browser/shell_integration.h"
|
| -#include "chrome/browser/ui/browser.h"
|
| -#include "chrome/browser/ui/browser_finder.h"
|
| -#include "chrome/browser/ui/webui/set_as_default_browser_ui.h"
|
| -#include "components/prefs/pref_service.h"
|
| +#include "chrome/browser/ui/webui/set_as_default_browser_ui_win.h"
|
| #include "components/startup_metric_utils/browser/startup_metric_utils.h"
|
| -#include "content/public/browser/browser_thread.h"
|
| -#include "content/public/browser/notification_service.h"
|
| -#include "content/public/browser/notification_types.h"
|
| -
|
| -using content::BrowserThread;
|
| -
|
| -namespace {
|
| -
|
| -// Show the page prompting the user to make Chrome the default browser on
|
| -// Windows 8 (which means becoming "the browser" in Metro mode). The page
|
| -// will be shown at the first appropriate opportunity. It can be placed in
|
| -// a tab or in a dialog, depending on other settings.
|
| -class SetMetroBrowserFlowLauncher : public content::NotificationObserver {
|
| - public:
|
| - static void LaunchSoon(Profile* profile) {
|
| - // The instance will manage its own lifetime.
|
| - new SetMetroBrowserFlowLauncher(profile);
|
| - }
|
| -
|
| - private:
|
| - explicit SetMetroBrowserFlowLauncher(Profile* profile)
|
| - : profile_(profile) {
|
| - registrar_.Add(this, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
|
| - content::NotificationService::AllSources());
|
| - }
|
| -
|
| - // content::NotificationObserver override:
|
| - void Observe(int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) override;
|
| -
|
| - content::NotificationRegistrar registrar_;
|
| - Profile* profile_;
|
| -
|
| - DISALLOW_COPY_AND_ASSIGN(SetMetroBrowserFlowLauncher);
|
| -};
|
| -
|
| -void SetMetroBrowserFlowLauncher::Observe(
|
| - int type,
|
| - const content::NotificationSource& source,
|
| - const content::NotificationDetails& details) {
|
| - DCHECK_EQ(content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, type);
|
| -
|
| - Browser* browser = chrome::FindBrowserWithWebContents(
|
| - content::Source<content::WebContents>(source).ptr());
|
| - if (!browser || !browser->is_type_tabbed())
|
| - return;
|
| -
|
| - // Unregister and delete.
|
| - registrar_.RemoveAll();
|
| - SetAsDefaultBrowserUI::Show(profile_, browser);
|
| - delete this;
|
| -}
|
| -
|
| -} // namespace
|
|
|
| namespace chrome {
|
|
|
| @@ -87,7 +27,7 @@ bool ShowFirstRunDefaultBrowserPrompt(Profile* profile) {
|
|
|
| if (show_status) {
|
| startup_metric_utils::SetNonBrowserUIDisplayed();
|
| - SetMetroBrowserFlowLauncher::LaunchSoon(profile);
|
| + SetAsDefaultBrowserUI::Show(profile);
|
| }
|
|
|
| return show_status;
|
|
|