Upstream version 5.34.104.0
[platform/framework/web/crosswalk.git] / src / chrome / browser / browser_process_impl.cc
index ac6f1c4..681515c 100644 (file)
@@ -64,8 +64,6 @@
 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
 #include "chrome/browser/shell_integration.h"
 #include "chrome/browser/status_icons/status_tray.h"
-#include "chrome/browser/storage_monitor/storage_monitor.h"
-#include "chrome/browser/thumbnails/render_widget_snapshot_taker.h"
 #include "chrome/browser/ui/bookmarks/bookmark_prompt_controller.h"
 #include "chrome/browser/ui/browser_dialogs.h"
 #include "chrome/browser/ui/browser_finder.h"
@@ -81,6 +79,7 @@
 #include "chrome/common/url_constants.h"
 #include "chrome/installer/util/google_update_constants.h"
 #include "components/policy/core/common/policy_service.h"
+#include "components/translate/core/browser/translate_download_manager.h"
 #include "content/public/browser/browser_thread.h"
 #include "content/public/browser/child_process_security_policy.h"
 #include "content/public/browser/notification_details.h"
 
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
 #include "chrome/browser/media_galleries/media_file_system_registry.h"
+#include "components/storage_monitor/storage_monitor.h"
 #endif
 
 #if defined(ENABLE_PLUGIN_INSTALLATION)
@@ -161,9 +161,6 @@ BrowserProcessImpl::BrowserProcessImpl(
       created_safe_browsing_service_(false),
       module_ref_count_(0),
       did_start_(false),
-      checked_for_new_frames_(false),
-      using_new_frames_(false),
-      render_widget_snapshot_taker_(new RenderWidgetSnapshotTaker),
       download_status_updater_(new DownloadStatusUpdater),
       local_state_task_runner_(local_state_task_runner) {
   g_browser_process = this;
@@ -266,11 +263,11 @@ void BrowserProcessImpl::StartTearDown() {
 
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
   media_file_system_registry_.reset();
-  // Delete |storage_monitor_| now. Otherwise the FILE thread would be gone
-  // when we try to release it in the dtor and Valgrind would report a
-  // leak on almost every single browser_test.
+  // Remove the global instance of the Storage Monitor now. Otherwise the
+  // FILE thread would be gone when we try to release it in the dtor and
+  // Valgrind would report a leak on almost every single browser_test.
   // TODO(gbillock): Make this unnecessary.
-  storage_monitor_.reset();
+  StorageMonitor::Destroy();
 #endif
 
   message_center::MessageCenter::Shutdown();
@@ -552,10 +549,6 @@ GpuModeManager* BrowserProcessImpl::gpu_mode_manager() {
   return gpu_mode_manager_.get();
 }
 
-RenderWidgetSnapshotTaker* BrowserProcessImpl::GetRenderWidgetSnapshotTaker() {
-  return render_widget_snapshot_taker_.get();
-}
-
 AutomationProviderList* BrowserProcessImpl::GetAutomationProviderList() {
   DCHECK(CalledOnValidThread());
 #if defined(ENABLE_AUTOMATION)
@@ -636,6 +629,7 @@ void BrowserProcessImpl::SetApplicationLocale(const std::string& locale) {
   locale_ = locale;
   extension_l10n_util::SetProcessLocale(locale);
   chrome::ChromeContentBrowserClient::SetApplicationLocale(locale);
+  TranslateDownloadManager::GetInstance()->set_application_locale(locale);
 }
 
 DownloadStatusUpdater* BrowserProcessImpl::download_status_updater() {
@@ -650,21 +644,6 @@ BookmarkPromptController* BrowserProcessImpl::bookmark_prompt_controller() {
 #endif
 }
 
-StorageMonitor* BrowserProcessImpl::storage_monitor() {
-#if defined(OS_ANDROID) || defined(OS_IOS)
-  return NULL;
-#else
-  return storage_monitor_.get();
-#endif
-}
-
-void BrowserProcessImpl::set_storage_monitor_for_test(
-    scoped_ptr<StorageMonitor> monitor) {
-#if !defined(OS_ANDROID) && !defined(OS_IOS)
-  storage_monitor_ = monitor.Pass();
-#endif
-}
-
 MediaFileSystemRegistry* BrowserProcessImpl::media_file_system_registry() {
 #if defined(OS_ANDROID) || defined(OS_IOS)
     return NULL;
@@ -976,7 +955,7 @@ void BrowserProcessImpl::PreMainMessageLoopRun() {
 #endif
 
 #if !defined(OS_ANDROID) && !defined(OS_IOS)
-  storage_monitor_.reset(StorageMonitor::Create());
+  StorageMonitor::Create();
 #endif
 
   platform_part_->PreMainMessageLoopRun();