Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(4172)

Unified Diff: chrome/browser/ui/startup/default_browser_prompt_win.cc

Issue 2090773002: Improves first run dialog performance on Win8 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: cr Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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;
« no previous file with comments | « no previous file | chrome/browser/ui/webui/chrome_web_ui_controller_factory.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698