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/ui/startup/startup_browser_creator.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
8 | 8 |
9 #include <algorithm> // For max(). | 9 #include <algorithm> // For max(). |
10 #include <limits> | 10 #include <limits> |
(...skipping 666 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
677 | 677 |
678 if (!process_startup && | 678 if (!process_startup && |
679 command_line.HasSwitch(switches::kDumpBrowserHistograms)) { | 679 command_line.HasSwitch(switches::kDumpBrowserHistograms)) { |
680 // Only handle --dump-browser-histograms from a rendezvous. In this case, do | 680 // Only handle --dump-browser-histograms from a rendezvous. In this case, do |
681 // not open a new browser window even if no output file was given. | 681 // not open a new browser window even if no output file was given. |
682 base::FilePath output_file( | 682 base::FilePath output_file( |
683 command_line.GetSwitchValuePath(switches::kDumpBrowserHistograms)); | 683 command_line.GetSwitchValuePath(switches::kDumpBrowserHistograms)); |
684 if (!output_file.empty()) { | 684 if (!output_file.empty()) { |
685 base::PostTaskWithTraits( | 685 base::PostTaskWithTraits( |
686 FROM_HERE, | 686 FROM_HERE, |
687 base::TaskTraits() | 687 {base::MayBlock(), base::TaskPriority::BACKGROUND, |
688 .MayBlock() | 688 base::TaskShutdownBehavior::BLOCK_SHUTDOWN}, |
689 .WithPriority(base::TaskPriority::BACKGROUND) | |
690 .WithShutdownBehavior(base::TaskShutdownBehavior::BLOCK_SHUTDOWN), | |
691 base::BindOnce(&DumpBrowserHistograms, output_file)); | 689 base::BindOnce(&DumpBrowserHistograms, output_file)); |
692 } | 690 } |
693 silent_launch = true; | 691 silent_launch = true; |
694 } | 692 } |
695 | 693 |
696 // If --no-startup-window is specified and Chrome is already running then do | 694 // If --no-startup-window is specified and Chrome is already running then do |
697 // not open a new window. | 695 // not open a new window. |
698 if (!process_startup && command_line.HasSwitch(switches::kNoStartupWindow)) | 696 if (!process_startup && command_line.HasSwitch(switches::kNoStartupWindow)) |
699 silent_launch = true; | 697 silent_launch = true; |
700 | 698 |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1020 if (!entry->IsSigninRequired()) { | 1018 if (!entry->IsSigninRequired()) { |
1021 Profile* profile = profile_manager->GetProfile(entry->GetPath()); | 1019 Profile* profile = profile_manager->GetProfile(entry->GetPath()); |
1022 if (profile) | 1020 if (profile) |
1023 return profile; | 1021 return profile; |
1024 } | 1022 } |
1025 } | 1023 } |
1026 | 1024 |
1027 return nullptr; | 1025 return nullptr; |
1028 } | 1026 } |
1029 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) | 1027 #endif // !defined(OS_CHROMEOS) && !defined(OS_ANDROID) |
OLD | NEW |