OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/browser_init.h" | 5 #include "chrome/browser/ui/browser_init.h" |
6 | 6 |
7 #include <algorithm> // For max(). | 7 #include <algorithm> // For max(). |
8 | 8 |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/resource_bundle.h" | 10 #include "app/resource_bundle.h" |
(...skipping 11 matching lines...) Expand all Loading... |
22 #include "chrome/browser/automation/automation_provider_list.h" | 22 #include "chrome/browser/automation/automation_provider_list.h" |
23 #include "chrome/browser/automation/chrome_frame_automation_provider.h" | 23 #include "chrome/browser/automation/chrome_frame_automation_provider.h" |
24 #include "chrome/browser/automation/testing_automation_provider.h" | 24 #include "chrome/browser/automation/testing_automation_provider.h" |
25 #include "chrome/browser/browser_list.h" | 25 #include "chrome/browser/browser_list.h" |
26 #include "chrome/browser/browser_process.h" | 26 #include "chrome/browser/browser_process.h" |
27 #include "chrome/browser/browser_thread.h" | 27 #include "chrome/browser/browser_thread.h" |
28 #include "chrome/browser/browser_window.h" | 28 #include "chrome/browser/browser_window.h" |
29 #include "chrome/browser/child_process_security_policy.h" | 29 #include "chrome/browser/child_process_security_policy.h" |
30 #include "chrome/browser/defaults.h" | 30 #include "chrome/browser/defaults.h" |
31 #include "chrome/browser/extensions/extension_creator.h" | 31 #include "chrome/browser/extensions/extension_creator.h" |
32 #include "chrome/browser/extensions/extensions_service.h" | 32 #include "chrome/browser/extensions/extension_service.h" |
33 #include "chrome/browser/extensions/pack_extension_job.h" | 33 #include "chrome/browser/extensions/pack_extension_job.h" |
34 #include "chrome/browser/first_run/first_run.h" | 34 #include "chrome/browser/first_run/first_run.h" |
35 #include "chrome/browser/net/predictor_api.h" | 35 #include "chrome/browser/net/predictor_api.h" |
36 #include "chrome/browser/net/url_fixer_upper.h" | 36 #include "chrome/browser/net/url_fixer_upper.h" |
37 #include "chrome/browser/notifications/desktop_notification_service.h" | 37 #include "chrome/browser/notifications/desktop_notification_service.h" |
38 #include "chrome/browser/prefs/pref_service.h" | 38 #include "chrome/browser/prefs/pref_service.h" |
39 #include "chrome/browser/prefs/session_startup_pref.h" | 39 #include "chrome/browser/prefs/session_startup_pref.h" |
40 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" | 40 #include "chrome/browser/printing/cloud_print/cloud_print_proxy_service.h" |
41 #include "chrome/browser/profiles/profile.h" | 41 #include "chrome/browser/profiles/profile.h" |
42 #include "chrome/browser/renderer_host/render_process_host.h" | 42 #include "chrome/browser/renderer_host/render_process_host.h" |
(...skipping 582 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
625 bool BrowserInit::LaunchWithProfile::OpenApplicationWindow(Profile* profile) { | 625 bool BrowserInit::LaunchWithProfile::OpenApplicationWindow(Profile* profile) { |
626 std::string url_string, app_id; | 626 std::string url_string, app_id; |
627 if (!IsAppLaunch(&url_string, &app_id)) | 627 if (!IsAppLaunch(&url_string, &app_id)) |
628 return false; | 628 return false; |
629 | 629 |
630 // This can fail if the app_id is invalid. It can also fail if the | 630 // This can fail if the app_id is invalid. It can also fail if the |
631 // extension is external, and has not yet been installed. | 631 // extension is external, and has not yet been installed. |
632 // TODO(skerner): Do something reasonable here. Pop up a warning panel? | 632 // TODO(skerner): Do something reasonable here. Pop up a warning panel? |
633 // Open an URL to the gallery page of the extension id? | 633 // Open an URL to the gallery page of the extension id? |
634 if (!app_id.empty()) { | 634 if (!app_id.empty()) { |
635 ExtensionsService* extensions_service = profile->GetExtensionsService(); | 635 ExtensionService* extensions_service = profile->GetExtensionService(); |
636 const Extension* extension = | 636 const Extension* extension = |
637 extensions_service->GetExtensionById(app_id, false); | 637 extensions_service->GetExtensionById(app_id, false); |
638 | 638 |
639 // The extension with id |app_id| may have been uninstalled. | 639 // The extension with id |app_id| may have been uninstalled. |
640 if (!extension) | 640 if (!extension) |
641 return false; | 641 return false; |
642 | 642 |
643 // Look at preferences to find the right launch container. If no | 643 // Look at preferences to find the right launch container. If no |
644 // preference is set, launch as a window. | 644 // preference is set, launch as a window. |
645 extension_misc::LaunchContainer launch_container = | 645 extension_misc::LaunchContainer launch_container = |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1093 scoped_refptr<AutomationProviderClass> automation = | 1093 scoped_refptr<AutomationProviderClass> automation = |
1094 new AutomationProviderClass(profile); | 1094 new AutomationProviderClass(profile); |
1095 automation->ConnectToChannel(channel_id); | 1095 automation->ConnectToChannel(channel_id); |
1096 automation->SetExpectedTabCount(expected_tabs); | 1096 automation->SetExpectedTabCount(expected_tabs); |
1097 | 1097 |
1098 AutomationProviderList* list = | 1098 AutomationProviderList* list = |
1099 g_browser_process->InitAutomationProviderList(); | 1099 g_browser_process->InitAutomationProviderList(); |
1100 DCHECK(list); | 1100 DCHECK(list); |
1101 list->AddProvider(automation); | 1101 list->AddProvider(automation); |
1102 } | 1102 } |
OLD | NEW |