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 <set> | 7 #include <set> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 535 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 #if defined(OS_WIN) | 546 #if defined(OS_WIN) |
547 // TODO(port) This should be used on Linux Aura as well. http://crbug.com/338969 | 547 // TODO(port) This should be used on Linux Aura as well. http://crbug.com/338969 |
548 const char kMissingLocaleDataMessage[] = | 548 const char kMissingLocaleDataMessage[] = |
549 "Unable to find locale data files. Please reinstall."; | 549 "Unable to find locale data files. Please reinstall."; |
550 #endif | 550 #endif |
551 | 551 |
552 } // namespace chrome_browser | 552 } // namespace chrome_browser |
553 | 553 |
554 // BrowserMainParts ------------------------------------------------------------ | 554 // BrowserMainParts ------------------------------------------------------------ |
555 | 555 |
556 // static | |
557 bool ChromeBrowserMainParts::disable_enforcing_cookie_policies_for_tests_ = | |
558 false; | |
559 | |
560 ChromeBrowserMainParts::ChromeBrowserMainParts( | 556 ChromeBrowserMainParts::ChromeBrowserMainParts( |
561 const content::MainFunctionParams& parameters) | 557 const content::MainFunctionParams& parameters) |
562 : parameters_(parameters), | 558 : parameters_(parameters), |
563 parsed_command_line_(parameters.command_line), | 559 parsed_command_line_(parameters.command_line), |
564 result_code_(content::RESULT_CODE_NORMAL_EXIT), | 560 result_code_(content::RESULT_CODE_NORMAL_EXIT), |
565 startup_watcher_(new StartupTimeBomb()), | 561 startup_watcher_(new StartupTimeBomb()), |
566 shutdown_watcher_(new ShutdownWatcherHelper()), | 562 shutdown_watcher_(new ShutdownWatcherHelper()), |
567 browser_field_trials_(parameters.command_line), | 563 browser_field_trials_(parameters.command_line), |
568 profile_(NULL), | 564 profile_(NULL), |
569 run_message_loop_(true), | 565 run_message_loop_(true), |
570 notify_result_(ProcessSingleton::PROCESS_NONE), | 566 notify_result_(ProcessSingleton::PROCESS_NONE), |
571 local_state_(NULL), | 567 local_state_(NULL), |
572 restart_last_session_(false) { | 568 restart_last_session_(false) { |
573 // If we're running tests (ui_task is non-null). | 569 // If we're running tests (ui_task is non-null). |
574 if (parameters.ui_task) | 570 if (parameters.ui_task) |
575 browser_defaults::enable_help_app = false; | 571 browser_defaults::enable_help_app = false; |
576 | 572 |
577 // Chrome disallows cookies by default. All code paths that want to use | 573 // Chrome disallows cookies by default. All code paths that want to use |
578 // cookies need to go through one of Chrome's URLRequestContexts which have | 574 // cookies need to go through one of Chrome's URLRequestContexts which have |
579 // a ChromeNetworkDelegate attached that selectively allows cookies again. | 575 // a ChromeNetworkDelegate attached that selectively allows cookies again. |
580 if (!disable_enforcing_cookie_policies_for_tests_) | 576 net::URLRequest::SetDefaultCookiePolicyToBlock(); |
581 net::URLRequest::SetDefaultCookiePolicyToBlock(); | |
582 } | 577 } |
583 | 578 |
584 ChromeBrowserMainParts::~ChromeBrowserMainParts() { | 579 ChromeBrowserMainParts::~ChromeBrowserMainParts() { |
585 for (int i = static_cast<int>(chrome_extra_parts_.size())-1; i >= 0; --i) | 580 for (int i = static_cast<int>(chrome_extra_parts_.size())-1; i >= 0; --i) |
586 delete chrome_extra_parts_[i]; | 581 delete chrome_extra_parts_[i]; |
587 chrome_extra_parts_.clear(); | 582 chrome_extra_parts_.clear(); |
588 } | 583 } |
589 | 584 |
590 // This will be called after the command-line has been mutated by about:flags | 585 // This will be called after the command-line has been mutated by about:flags |
591 void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { | 586 void ChromeBrowserMainParts::SetupMetricsAndFieldTrials() { |
(...skipping 1121 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1713 chromeos::CrosSettings::Shutdown(); | 1708 chromeos::CrosSettings::Shutdown(); |
1714 #endif | 1709 #endif |
1715 #endif | 1710 #endif |
1716 } | 1711 } |
1717 | 1712 |
1718 // Public members: | 1713 // Public members: |
1719 | 1714 |
1720 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { | 1715 void ChromeBrowserMainParts::AddParts(ChromeBrowserMainExtraParts* parts) { |
1721 chrome_extra_parts_.push_back(parts); | 1716 chrome_extra_parts_.push_back(parts); |
1722 } | 1717 } |
OLD | NEW |