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/browser_process_impl.h" | 5 #include "chrome/browser/browser_process_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <map> | 8 #include <map> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
556 // TODO(abarth): DCHECK(CalledOnValidThread()); | 556 // TODO(abarth): DCHECK(CalledOnValidThread()); |
557 // http://code.google.com/p/chromium/issues/detail?id=6828 | 557 // http://code.google.com/p/chromium/issues/detail?id=6828 |
558 // print_job_manager_ is initialized in the constructor and destroyed in the | 558 // print_job_manager_ is initialized in the constructor and destroyed in the |
559 // destructor, so it should always be valid. | 559 // destructor, so it should always be valid. |
560 DCHECK(print_job_manager_.get()); | 560 DCHECK(print_job_manager_.get()); |
561 return print_job_manager_.get(); | 561 return print_job_manager_.get(); |
562 } | 562 } |
563 | 563 |
564 printing::PrintPreviewDialogController* | 564 printing::PrintPreviewDialogController* |
565 BrowserProcessImpl::print_preview_dialog_controller() { | 565 BrowserProcessImpl::print_preview_dialog_controller() { |
566 #if defined(ENABLE_PRINTING) | 566 #if defined(ENABLE_FULL_PRINTING) |
567 DCHECK(CalledOnValidThread()); | 567 DCHECK(CalledOnValidThread()); |
568 if (!print_preview_dialog_controller_.get()) | 568 if (!print_preview_dialog_controller_.get()) |
569 CreatePrintPreviewDialogController(); | 569 CreatePrintPreviewDialogController(); |
570 return print_preview_dialog_controller_.get(); | 570 return print_preview_dialog_controller_.get(); |
571 #else | 571 #else |
572 NOTIMPLEMENTED(); | 572 NOTIMPLEMENTED(); |
573 return NULL; | 573 return NULL; |
574 #endif | 574 #endif |
575 } | 575 } |
576 | 576 |
577 printing::BackgroundPrintingManager* | 577 printing::BackgroundPrintingManager* |
578 BrowserProcessImpl::background_printing_manager() { | 578 BrowserProcessImpl::background_printing_manager() { |
579 #if defined(ENABLE_PRINTING) | 579 #if defined(ENABLE_FULL_PRINTING) |
580 DCHECK(CalledOnValidThread()); | 580 DCHECK(CalledOnValidThread()); |
581 if (!background_printing_manager_.get()) | 581 if (!background_printing_manager_.get()) |
582 CreateBackgroundPrintingManager(); | 582 CreateBackgroundPrintingManager(); |
583 return background_printing_manager_.get(); | 583 return background_printing_manager_.get(); |
584 #else | 584 #else |
585 NOTIMPLEMENTED(); | 585 NOTIMPLEMENTED(); |
586 return NULL; | 586 return NULL; |
587 #endif | 587 #endif |
588 } | 588 } |
589 | 589 |
(...skipping 367 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
957 new BackgroundModeManager(CommandLine::ForCurrentProcess(), | 957 new BackgroundModeManager(CommandLine::ForCurrentProcess(), |
958 &profile_manager()->GetProfileInfoCache())); | 958 &profile_manager()->GetProfileInfoCache())); |
959 } | 959 } |
960 | 960 |
961 void BrowserProcessImpl::CreateStatusTray() { | 961 void BrowserProcessImpl::CreateStatusTray() { |
962 DCHECK(status_tray_.get() == NULL); | 962 DCHECK(status_tray_.get() == NULL); |
963 status_tray_.reset(StatusTray::Create()); | 963 status_tray_.reset(StatusTray::Create()); |
964 } | 964 } |
965 | 965 |
966 void BrowserProcessImpl::CreatePrintPreviewDialogController() { | 966 void BrowserProcessImpl::CreatePrintPreviewDialogController() { |
967 #if defined(ENABLE_PRINTING) | 967 #if defined(ENABLE_FULL_PRINTING) |
968 DCHECK(print_preview_dialog_controller_.get() == NULL); | 968 DCHECK(print_preview_dialog_controller_.get() == NULL); |
969 print_preview_dialog_controller_ = | 969 print_preview_dialog_controller_ = |
970 new printing::PrintPreviewDialogController(); | 970 new printing::PrintPreviewDialogController(); |
971 #else | 971 #else |
972 NOTIMPLEMENTED(); | 972 NOTIMPLEMENTED(); |
973 #endif | 973 #endif |
974 } | 974 } |
975 | 975 |
976 void BrowserProcessImpl::CreateBackgroundPrintingManager() { | 976 void BrowserProcessImpl::CreateBackgroundPrintingManager() { |
977 #if defined(ENABLE_PRINTING) | 977 #if defined(ENABLE_FULL_PRINTING) |
978 DCHECK(background_printing_manager_.get() == NULL); | 978 DCHECK(background_printing_manager_.get() == NULL); |
979 background_printing_manager_.reset(new printing::BackgroundPrintingManager()); | 979 background_printing_manager_.reset(new printing::BackgroundPrintingManager()); |
980 #else | 980 #else |
981 NOTIMPLEMENTED(); | 981 NOTIMPLEMENTED(); |
982 #endif | 982 #endif |
983 } | 983 } |
984 | 984 |
985 void BrowserProcessImpl::CreateSafeBrowsingService() { | 985 void BrowserProcessImpl::CreateSafeBrowsingService() { |
986 DCHECK(safe_browsing_service_.get() == NULL); | 986 DCHECK(safe_browsing_service_.get() == NULL); |
987 // Set this flag to true so that we don't retry indefinitely to | 987 // Set this flag to true so that we don't retry indefinitely to |
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 } | 1056 } |
1057 | 1057 |
1058 void BrowserProcessImpl::OnAutoupdateTimer() { | 1058 void BrowserProcessImpl::OnAutoupdateTimer() { |
1059 if (CanAutorestartForUpdate()) { | 1059 if (CanAutorestartForUpdate()) { |
1060 DLOG(WARNING) << "Detected update. Restarting browser."; | 1060 DLOG(WARNING) << "Detected update. Restarting browser."; |
1061 RestartBackgroundInstance(); | 1061 RestartBackgroundInstance(); |
1062 } | 1062 } |
1063 } | 1063 } |
1064 | 1064 |
1065 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) | 1065 #endif // (defined(OS_WIN) || defined(OS_LINUX)) && !defined(OS_CHROMEOS) |
OLD | NEW |