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

Side by Side Diff: chrome/browser/ui/startup/default_browser_prompt_win.cc

Issue 10702097: Adds browser preferences to configure first-run flow on Windows 8. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merged suppress-dialog and check-default-on-first run prefs. Created 8 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "chrome/browser/ui/startup/default_browser_prompt.h" 5 #include "chrome/browser/ui/startup/default_browser_prompt.h"
6 6
7 #include "chrome/browser/prefs/pref_service.h" 7 #include "chrome/browser/prefs/pref_service.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "chrome/browser/shell_integration.h" 9 #include "chrome/browser/shell_integration.h"
10 #include "chrome/browser/ui/browser.h" 10 #include "chrome/browser/ui/browser.h"
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 const content::NotificationDetails& details) { 54 const content::NotificationDetails& details) {
55 DCHECK_EQ(type, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME); 55 DCHECK_EQ(type, content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME);
56 Browser* browser = browser::FindBrowserWithWebContents( 56 Browser* browser = browser::FindBrowserWithWebContents(
57 content::Source<content::WebContents>(source).ptr()); 57 content::Source<content::WebContents>(source).ptr());
58 58
59 if (!browser || !browser->is_type_tabbed()) 59 if (!browser || !browser->is_type_tabbed())
60 return; 60 return;
61 61
62 // Unregister and delete. 62 // Unregister and delete.
63 registrar_.RemoveAll(); 63 registrar_.RemoveAll();
64 bool as_dialog = 64 SetAsDefaultBrowserUI::Show(profile_, browser);
65 profile_->GetPrefs()->GetBoolean(prefs::kDefaultBrowserFlowDialog);
66
67 SetAsDefaultBrowserUI::Show(profile_, browser, as_dialog);
68 delete this; 65 delete this;
69 } 66 }
70 67
71 } // namespace 68 } // namespace
72 69
73 namespace chrome { 70 namespace chrome {
74 71
75 void ShowFirstRunDefaultBrowserPrompt(Profile* profile) { 72 void ShowFirstRunDefaultBrowserPrompt(Profile* profile) {
76 if ((ShellIntegration::IsDefaultBrowser() == 73 if ((ShellIntegration::IsDefaultBrowser() ==
77 ShellIntegration::NOT_DEFAULT_WEB_CLIENT) && 74 ShellIntegration::NOT_DEFAULT_WEB_CLIENT) &&
78 (ShellIntegration::CanSetAsDefaultBrowser() == 75 (ShellIntegration::CanSetAsDefaultBrowser() ==
79 ShellIntegration::SET_DEFAULT_INTERACTIVE)) { 76 ShellIntegration::SET_DEFAULT_INTERACTIVE)) {
80 // If the only available mode of setting the default browser requires 77 // If the only available mode of setting the default browser requires
81 // user interaction, it means this couldn't have been done yet. 78 // user interaction, it means this couldn't have been done yet.
82 SetMetroBrowserFlowLauncher::LaunchSoon(profile); 79 SetMetroBrowserFlowLauncher::LaunchSoon(profile);
83 } 80 }
84 } 81 }
85 82
86 } // namespace chrome 83 } // namespace chrome
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698