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

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

Issue 2904823002: Inactive toast ux changes (Closed)
Patch Set: rebase, comments Created 3 years, 4 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 1280 matching lines...) Expand 10 before | Expand all | Expand 10 after
1508 std::string try_chrome = 1508 std::string try_chrome =
1509 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain); 1509 parsed_command_line().GetSwitchValueASCII(switches::kTryChromeAgain);
1510 if (!try_chrome.empty()) { 1510 if (!try_chrome.empty()) {
1511 #if defined(OS_WIN) 1511 #if defined(OS_WIN)
1512 // Setup.exe has determined that we need to run a retention experiment 1512 // Setup.exe has determined that we need to run a retention experiment
1513 // and has lauched chrome to show the experiment UI. It is guaranteed that 1513 // and has lauched chrome to show the experiment UI. It is guaranteed that
1514 // no other Chrome is currently running as the process singleton was 1514 // no other Chrome is currently running as the process singleton was
1515 // successfully grabbed above. 1515 // successfully grabbed above.
1516 int try_chrome_int; 1516 int try_chrome_int;
1517 base::StringToInt(try_chrome, &try_chrome_int); 1517 base::StringToInt(try_chrome, &try_chrome_int);
1518 TryChromeDialogView::Result answer = TryChromeDialogView::Show( 1518 TryChromeDialog::Result answer = TryChromeDialog::Show(
1519 try_chrome_int, 1519 try_chrome_int,
1520 base::Bind(&ChromeProcessSingleton::SetActiveModalDialog, 1520 base::Bind(&ChromeProcessSingleton::SetActiveModalDialog,
1521 base::Unretained(process_singleton_.get()))); 1521 base::Unretained(process_singleton_.get())));
1522 if (answer == TryChromeDialogView::NOT_NOW) 1522 switch (answer) {
1523 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; 1523 case TryChromeDialog::NOT_NOW:
1524 if (answer == TryChromeDialogView::UNINSTALL_CHROME) 1524 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL;
1525 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; 1525 case TryChromeDialog::OPEN_CHROME_WELCOME:
1526 // At this point the user is willing to try chrome again. 1526 browser_creator_->set_welcome_back_page(
1527 if (answer == TryChromeDialogView::TRY_CHROME_AS_DEFAULT) { 1527 StartupBrowserCreator::WelcomeBackPage::kWelcomeStandard);
1528 // Only set in the unattended case. This is not true on Windows 8+. 1528 case TryChromeDialog::OPEN_CHROME_WELCOME_WIN10:
1529 if (shell_integration::GetDefaultWebClientSetPermission() == 1529 browser_creator_->set_welcome_back_page(
1530 shell_integration::SET_DEFAULT_UNATTENDED) { 1530 StartupBrowserCreator::WelcomeBackPage::kWelcomeWin10);
1531 shell_integration::SetAsDefaultBrowser(); 1531 case TryChromeDialog::OPEN_CHROME_DEFAULT:
grt (UTC plus 2) 2017/08/17 11:26:32 nit: the pedant in me would like to see this as th
skare_ 2017/08/18 11:37:33 Done. Didn't change this code but moved OPEN_CHROM
1532 } 1532 break;
1533 } 1533 }
1534 #else 1534 #else
1535 // We don't support retention experiments on Mac or Linux. 1535 // We don't support retention experiments on Mac or Linux.
1536 return content::RESULT_CODE_NORMAL_EXIT; 1536 return content::RESULT_CODE_NORMAL_EXIT;
1537 #endif // defined(OS_WIN) 1537 #endif // defined(OS_WIN)
1538 } 1538 }
1539 1539
1540 #if defined(OS_WIN) 1540 #if defined(OS_WIN)
1541 // Do the tasks if chrome has been upgraded while it was last running. 1541 // Do the tasks if chrome has been upgraded while it was last running.
1542 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line())) 1542 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line()))
(...skipping 477 matching lines...) Expand 10 before | Expand all | Expand 10 after
2020 chromeos::CrosSettings::Shutdown(); 2020 chromeos::CrosSettings::Shutdown();
2021 #endif // defined(OS_CHROMEOS) 2021 #endif // defined(OS_CHROMEOS)
2022 #endif // defined(OS_ANDROID) 2022 #endif // defined(OS_ANDROID)
2023 } 2023 }
2024 2024
2025 // Public members: 2025 // Public members:
2026 2026
2027 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { 2027 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) {
2028 chrome_extra_parts_.push_back(parts); 2028 chrome_extra_parts_.push_back(parts);
2029 } 2029 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698