| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/first_run/first_run.h" | 5 #include "chrome/browser/first_run/first_run.h" |
| 6 | 6 |
| 7 #include <shlobj.h> | 7 #include <shlobj.h> |
| 8 #include <windows.h> | 8 #include <windows.h> |
| 9 | 9 |
| 10 #include <set> | 10 #include <set> |
| (...skipping 19 matching lines...) Expand all Loading... |
| 30 #include "chrome/common/chrome_notification_types.h" | 30 #include "chrome/common/chrome_notification_types.h" |
| 31 #include "chrome/common/chrome_result_codes.h" | 31 #include "chrome/common/chrome_result_codes.h" |
| 32 #include "chrome/common/chrome_switches.h" | 32 #include "chrome/common/chrome_switches.h" |
| 33 #include "chrome/common/worker_thread_ticker.h" | 33 #include "chrome/common/worker_thread_ticker.h" |
| 34 #include "chrome/installer/util/browser_distribution.h" | 34 #include "chrome/installer/util/browser_distribution.h" |
| 35 #include "chrome/installer/util/install_util.h" | 35 #include "chrome/installer/util/install_util.h" |
| 36 #include "chrome/installer/util/master_preferences.h" | 36 #include "chrome/installer/util/master_preferences.h" |
| 37 #include "chrome/installer/util/shell_util.h" | 37 #include "chrome/installer/util/shell_util.h" |
| 38 #include "chrome/installer/util/util_constants.h" | 38 #include "chrome/installer/util/util_constants.h" |
| 39 #include "content/browser/user_metrics.h" | 39 #include "content/browser/user_metrics.h" |
| 40 #include "content/common/notification_service.h" | 40 #include "content/public/browser/notification_service.h" |
| 41 #include "google_update_idl.h" | 41 #include "google_update_idl.h" |
| 42 #include "grit/chromium_strings.h" | 42 #include "grit/chromium_strings.h" |
| 43 #include "grit/generated_resources.h" | 43 #include "grit/generated_resources.h" |
| 44 #include "grit/locale_settings.h" | 44 #include "grit/locale_settings.h" |
| 45 #include "grit/theme_resources.h" | 45 #include "grit/theme_resources.h" |
| 46 #include "ui/base/resource/resource_bundle.h" | 46 #include "ui/base/resource/resource_bundle.h" |
| 47 #include "ui/base/ui_base_switches.h" | 47 #include "ui/base/ui_base_switches.h" |
| 48 | 48 |
| 49 namespace { | 49 namespace { |
| 50 | 50 |
| 51 // Helper class that performs delayed first-run tasks that need more of the | 51 // Helper class that performs delayed first-run tasks that need more of the |
| 52 // chrome infrastructure to be up and running before they can be attempted. | 52 // chrome infrastructure to be up and running before they can be attempted. |
| 53 class FirstRunDelayedTasks : public content::NotificationObserver { | 53 class FirstRunDelayedTasks : public content::NotificationObserver { |
| 54 public: | 54 public: |
| 55 enum Tasks { | 55 enum Tasks { |
| 56 NO_TASK, | 56 NO_TASK, |
| 57 INSTALL_EXTENSIONS | 57 INSTALL_EXTENSIONS |
| 58 }; | 58 }; |
| 59 | 59 |
| 60 explicit FirstRunDelayedTasks(Tasks task) { | 60 explicit FirstRunDelayedTasks(Tasks task) { |
| 61 if (task == INSTALL_EXTENSIONS) { | 61 if (task == INSTALL_EXTENSIONS) { |
| 62 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, | 62 registrar_.Add(this, chrome::NOTIFICATION_EXTENSIONS_READY, |
| 63 NotificationService::AllSources()); | 63 content::NotificationService::AllSources()); |
| 64 } | 64 } |
| 65 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, | 65 registrar_.Add(this, chrome::NOTIFICATION_BROWSER_CLOSED, |
| 66 NotificationService::AllSources()); | 66 content::NotificationService::AllSources()); |
| 67 } | 67 } |
| 68 | 68 |
| 69 virtual void Observe(int type, | 69 virtual void Observe(int type, |
| 70 const content::NotificationSource& source, | 70 const content::NotificationSource& source, |
| 71 const content::NotificationDetails& details) { | 71 const content::NotificationDetails& details) { |
| 72 // After processing the notification we always delete ourselves. | 72 // After processing the notification we always delete ourselves. |
| 73 if (type == chrome::NOTIFICATION_EXTENSIONS_READY) { | 73 if (type == chrome::NOTIFICATION_EXTENSIONS_READY) { |
| 74 DoExtensionWork( | 74 DoExtensionWork( |
| 75 content::Source<Profile>(source).ptr()->GetExtensionService()); | 75 content::Source<Profile>(source).ptr()->GetExtensionService()); |
| 76 } | 76 } |
| (...skipping 330 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 407 parent_window, | 407 parent_window, |
| 408 static_cast<uint16>(items_to_import), | 408 static_cast<uint16>(items_to_import), |
| 409 importer_host, | 409 importer_host, |
| 410 &importer_observer, | 410 &importer_observer, |
| 411 importer_list->GetSourceProfileForImporterType(importer_type), | 411 importer_list->GetSourceProfileForImporterType(importer_type), |
| 412 profile, | 412 profile, |
| 413 true); | 413 true); |
| 414 importer_observer.RunLoop(); | 414 importer_observer.RunLoop(); |
| 415 return importer_observer.import_result(); | 415 return importer_observer.import_result(); |
| 416 } | 416 } |
| OLD | NEW |