Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 1541 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1552 // Setup.exe has determined that we need to run a retention experiment | 1552 // Setup.exe has determined that we need to run a retention experiment |
| 1553 // and has lauched chrome to show the experiment UI. It is guaranteed that | 1553 // and has lauched chrome to show the experiment UI. It is guaranteed that |
| 1554 // no other Chrome is currently running as the process singleton was | 1554 // no other Chrome is currently running as the process singleton was |
| 1555 // successfully grabbed above. | 1555 // successfully grabbed above. |
| 1556 int try_chrome_int; | 1556 int try_chrome_int; |
| 1557 base::StringToInt(try_chrome, &try_chrome_int); | 1557 base::StringToInt(try_chrome, &try_chrome_int); |
| 1558 TryChromeDialogView::Result answer = TryChromeDialogView::Show( | 1558 TryChromeDialogView::Result answer = TryChromeDialogView::Show( |
| 1559 try_chrome_int, | 1559 try_chrome_int, |
| 1560 base::Bind(&ChromeProcessSingleton::SetActiveModalDialog, | 1560 base::Bind(&ChromeProcessSingleton::SetActiveModalDialog, |
| 1561 base::Unretained(process_singleton_.get()))); | 1561 base::Unretained(process_singleton_.get()))); |
| 1562 if (answer == TryChromeDialogView::NOT_NOW) | 1562 if (answer == TryChromeDialogView::NOT_NOW) { |
|
grt (UTC plus 2)
2017/06/22 20:34:03
since the NOT_NOW and !OPEN_CHROME branches are th
skare_
2017/06/22 23:25:17
Done.
| |
| 1563 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; | 1563 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; |
| 1564 if (answer == TryChromeDialogView::UNINSTALL_CHROME) | 1564 } else if (answer == TryChromeDialogView::OPEN_CHROME) { |
| 1565 return chrome::RESULT_CODE_NORMAL_EXIT_EXP2; | 1565 StartupBrowserCreator::WelcomeBackPage welcome_page = |
| 1566 // At this point the user is willing to try chrome again. | 1566 TryChromeDialogView::GetWelcomePageForFlavor(try_chrome_int); |
| 1567 if (answer == TryChromeDialogView::TRY_CHROME_AS_DEFAULT) { | 1567 if (welcome_page != StartupBrowserCreator::WelcomeBackPage::kNone) { |
|
grt (UTC plus 2)
2017/06/22 20:34:03
nit: omit braces here
skare_
2017/06/22 23:25:17
Done.
| |
| 1568 // Only set in the unattended case. This is not true on Windows 8+. | 1568 browser_creator_->set_welcome_back_page(welcome_page); |
| 1569 if (shell_integration::GetDefaultWebClientSetPermission() == | |
| 1570 shell_integration::SET_DEFAULT_UNATTENDED) { | |
| 1571 shell_integration::SetAsDefaultBrowser(); | |
| 1572 } | 1569 } |
| 1570 } else { | |
| 1571 return chrome::RESULT_CODE_NORMAL_EXIT_CANCEL; | |
| 1573 } | 1572 } |
| 1574 #else | 1573 #else |
| 1575 // We don't support retention experiments on Mac or Linux. | 1574 // We don't support retention experiments on Mac or Linux. |
| 1576 return content::RESULT_CODE_NORMAL_EXIT; | 1575 return content::RESULT_CODE_NORMAL_EXIT; |
| 1577 #endif // defined(OS_WIN) | 1576 #endif // defined(OS_WIN) |
| 1578 } | 1577 } |
| 1579 | 1578 |
| 1580 #if defined(OS_WIN) | 1579 #if defined(OS_WIN) |
| 1581 // Do the tasks if chrome has been upgraded while it was last running. | 1580 // Do the tasks if chrome has been upgraded while it was last running. |
| 1582 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line())) | 1581 if (!already_running && upgrade_util::DoUpgradeTasks(parsed_command_line())) |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2054 chromeos::CrosSettings::Shutdown(); | 2053 chromeos::CrosSettings::Shutdown(); |
| 2055 #endif // defined(OS_CHROMEOS) | 2054 #endif // defined(OS_CHROMEOS) |
| 2056 #endif // defined(OS_ANDROID) | 2055 #endif // defined(OS_ANDROID) |
| 2057 } | 2056 } |
| 2058 | 2057 |
| 2059 // Public members: | 2058 // Public members: |
| 2060 | 2059 |
| 2061 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 2060 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
| 2062 chrome_extra_parts_.push_back(parts); | 2061 chrome_extra_parts_.push_back(parts); |
| 2063 } | 2062 } |
| OLD | NEW |