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

Side by Side Diff: chrome/browser/chrome_browser_main.cc

Issue 2904823002: Inactive toast ux changes (Closed)
Patch Set: Review / style fixes Created 3 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
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/chrome_browser_main.h" 5 #include "chrome/browser/chrome_browser_main.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 #include <stdint.h> 8 #include <stdint.h>
9 9
10 #include <set> 10 #include <set>
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after
207 // progress and should not be taken as an indication of a real refactoring. 207 // progress and should not be taken as an indication of a real refactoring.
208 208
209 #if defined(OS_WIN) 209 #if defined(OS_WIN)
210 #include "base/trace_event/trace_event_etw_export_win.h" 210 #include "base/trace_event/trace_event_etw_export_win.h"
211 #include "base/win/win_util.h" 211 #include "base/win/win_util.h"
212 #include "chrome/browser/chrome_browser_main_win.h" 212 #include "chrome/browser/chrome_browser_main_win.h"
213 #include "chrome/browser/component_updater/sw_reporter_installer_win.h" 213 #include "chrome/browser/component_updater/sw_reporter_installer_win.h"
214 #include "chrome/browser/downgrade/user_data_downgrade.h" 214 #include "chrome/browser/downgrade/user_data_downgrade.h"
215 #include "chrome/browser/first_run/upgrade_util_win.h" 215 #include "chrome/browser/first_run/upgrade_util_win.h"
216 #include "chrome/browser/ui/network_profile_bubble.h" 216 #include "chrome/browser/ui/network_profile_bubble.h"
217 #include "chrome/browser/ui/views/try_chrome_dialog_view.h" 217 #include "chrome/browser/ui/views/try_chrome_dialog.h"
218 #include "chrome/browser/win/browser_util.h" 218 #include "chrome/browser/win/browser_util.h"
219 #include "chrome/browser/win/chrome_select_file_dialog_factory.h" 219 #include "chrome/browser/win/chrome_select_file_dialog_factory.h"
220 #include "chrome/install_static/install_util.h" 220 #include "chrome/install_static/install_util.h"
221 #include "ui/base/l10n/l10n_util_win.h" 221 #include "ui/base/l10n/l10n_util_win.h"
222 #include "ui/shell_dialogs/select_file_dialog.h" 222 #include "ui/shell_dialogs/select_file_dialog.h"
223 #endif // defined(OS_WIN) 223 #endif // defined(OS_WIN)
224 224
225 #if defined(OS_MACOSX) 225 #if defined(OS_MACOSX)
226 #include <Security/Security.h> 226 #include <Security/Security.h>
227 227
(...skipping 1331 matching lines...) Expand 10 before | Expand all | Expand 10 after
1559 std::string try_chrome = 1559 std::string try_chrome =
1560 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain); 1560 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain);
1561 if (!try_chrome.empty()) { 1561 if (!try_chrome.empty()) {
1562 #if defined(OS_WIN) 1562 #if defined(OS_WIN)
1563 // Setup.exe has determined that we need to run a retention experiment 1563 // Setup.exe has determined that we need to run a retention experiment
1564 // and has lauched chrome to show the experiment UI. It is guaranteed that 1564 // and has lauched chrome to show the experiment UI. It is guaranteed that
1565 // no other Chrome is currently running as the process singleton was 1565 // no other Chrome is currently running as the process singleton was
1566 // successfully grabbed above. 1566 // successfully grabbed above.
1567 int try_chrome_int; 1567 int try_chrome_int;
1568 base::StringToInt(try_chrome, &try_chrome_int); 1568 base::StringToInt(try_chrome, &try_chrome_int);
1569 TryChromeDialogView::Result answer = TryChromeDialogView::Show( 1569 TryChromeDialog::Result answer = TryChromeDialog::Show(
1570 try_chrome_int, 1570 try_chrome_int,
1571 base::Bind(&ChromeProcessSingleton::SetActiveModalDialog, 1571 base::Bind(&ChromeProcessSingleton::SetActiveModalDialog,
1572 base::Unretained(process_singleton_.get()))); 1572 base::Unretained(process_singleton_.get())));
1573 if (answer == TryChromeDialogView::NOT_NOW) 1573 switch (answer) {
1574 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; 1574 case TryChromeDialog::NOT_NOW:
1575 if (answer == TryChromeDialogView::UNINSTALL_CHROME) 1575 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL;
1576 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; 1576 case TryChromeDialog::OPEN_CHROME_WELCOME:
1577 // At this point the user is willing to try chrome again. 1577 browser_creator_->set_welcome_back_page(
1578 if (answer == TryChromeDialogView::TRY_CHROME_AS_DEFAULT) { 1578 StartupBrowserCreator::WelcomeBackPage::kWelcomeStandard);
1579 // Only set in the unattended case. This is not true on Windows 8+. 1579 case TryChromeDialog::OPEN_CHROME_WELCOME_WIN10:
1580 if (shell_integration::GetDefaultWebClientSetPermission() == 1580 browser_creator_->set_welcome_back_page(
1581 shell_integration::SET_DEFAULT_UNATTENDED) { 1581 StartupBrowserCreator::WelcomeBackPage::kWelcomeWin10);
1582 shell_integration::SetAsDefaultBrowser();
1583 }
1584 } 1582 }
1585 #else 1583 #else
1586 // We don't support retention experiments on Mac or Linux. 1584 // We don't support retention experiments on Mac or Linux.
1587 return content::RESULT_CODE_NORMAL_EXIT; 1585 return content::RESULT_CODE_NORMAL_EXIT;
1588 #endif // defined(OS_WIN) 1586 #endif // defined(OS_WIN)
1589 } 1587 }
1590 1588
1591 #if defined(OS_WIN) 1589 #if defined(OS_WIN)
1592 // Do the tasks if chrome has been upgraded while it was last running. 1590 // Do the tasks if chrome has been upgraded while it was last running.
1593 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line())) 1591 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line()))
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2071 chromeos::CrosSettings::Shutdown(); 2069 chromeos::CrosSettings::Shutdown();
2072 #endif // defined(OS_CHROMEOS) 2070 #endif // defined(OS_CHROMEOS)
2073 #endif // defined(OS_ANDROID) 2071 #endif // defined(OS_ANDROID)
2074 } 2072 }
2075 2073
2076 // Public members: 2074 // Public members:
2077 2075
2078 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2076 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2079 chrome_extra_parts_.push_back(parts); 2077 chrome_extra_parts_.push_back(parts);
2080 } 2078 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698