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/browser_init.h" | 5 #include "chrome/browser/browser_init.h" |
6 | 6 |
7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
8 #include "app/resource_bundle.h" | 8 #include "app/resource_bundle.h" |
9 #include "base/event_recorder.h" | 9 #include "base/event_recorder.h" |
10 #include "base/path_service.h" | 10 #include "base/path_service.h" |
(...skipping 561 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
572 // http://crbug.com/37548 | 572 // http://crbug.com/37548 |
573 // TODO(rafaelw): There are two legitimate cases where the extensions | 573 // TODO(rafaelw): There are two legitimate cases where the extensions |
574 // service could not be ready at this point which need to be handled: | 574 // service could not be ready at this point which need to be handled: |
575 // 1) The locale has changed and the manifests stored in the preferences | 575 // 1) The locale has changed and the manifests stored in the preferences |
576 // need to be relocalized. | 576 // need to be relocalized. |
577 // 2) An externally installed extension will be found and installed. | 577 // 2) An externally installed extension will be found and installed. |
578 // Note that this can also fail if the app_id is simply invalid. | 578 // Note that this can also fail if the app_id is simply invalid. |
579 // TODO(rafaelw): Do something reasonable here. Pop up a warning panel? | 579 // TODO(rafaelw): Do something reasonable here. Pop up a warning panel? |
580 // Open an URL to the gallery page of the extension id? | 580 // Open an URL to the gallery page of the extension id? |
581 if (!app_id.empty()) | 581 if (!app_id.empty()) |
582 return Browser::OpenApplication(profile, app_id); | 582 return Browser::OpenApplication(profile, app_id) != NULL; |
583 | 583 |
584 if (url_string.empty()) | 584 if (url_string.empty()) |
585 return false; | 585 return false; |
586 | 586 |
587 #if defined(OS_WIN) // Fix up Windows shortcuts. | 587 #if defined(OS_WIN) // Fix up Windows shortcuts. |
588 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); | 588 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); |
589 #endif | 589 #endif |
590 GURL url(url_string); | 590 GURL url(url_string); |
591 | 591 |
592 // Restrict allowed URLs for --app switch. | 592 // Restrict allowed URLs for --app switch. |
593 if (!url.is_empty() && url.is_valid()) { | 593 if (!url.is_empty() && url.is_valid()) { |
594 ChildProcessSecurityPolicy *policy = | 594 ChildProcessSecurityPolicy *policy = |
595 ChildProcessSecurityPolicy::GetInstance(); | 595 ChildProcessSecurityPolicy::GetInstance(); |
596 if (policy->IsWebSafeScheme(url.scheme()) || | 596 if (policy->IsWebSafeScheme(url.scheme()) || |
597 url.SchemeIs(chrome::kFileScheme)) { | 597 url.SchemeIs(chrome::kFileScheme)) { |
598 Browser::OpenApplicationWindow(profile, NULL, url, false); | 598 Browser::OpenApplicationWindow(profile, url); |
599 return true; | 599 return true; |
600 } | 600 } |
601 } | 601 } |
602 return false; | 602 return false; |
603 } | 603 } |
604 | 604 |
605 void BrowserInit::LaunchWithProfile::ProcessLaunchURLs( | 605 void BrowserInit::LaunchWithProfile::ProcessLaunchURLs( |
606 bool process_startup, | 606 bool process_startup, |
607 const std::vector<GURL>& urls_to_open) { | 607 const std::vector<GURL>& urls_to_open) { |
608 if (process_startup && ProcessStartupURLs(urls_to_open)) { | 608 if (process_startup && ProcessStartupURLs(urls_to_open)) { |
(...skipping 441 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1050 scoped_refptr<AutomationProviderClass> automation = | 1050 scoped_refptr<AutomationProviderClass> automation = |
1051 new AutomationProviderClass(profile); | 1051 new AutomationProviderClass(profile); |
1052 automation->ConnectToChannel(channel_id); | 1052 automation->ConnectToChannel(channel_id); |
1053 automation->SetExpectedTabCount(expected_tabs); | 1053 automation->SetExpectedTabCount(expected_tabs); |
1054 | 1054 |
1055 AutomationProviderList* list = | 1055 AutomationProviderList* list = |
1056 g_browser_process->InitAutomationProviderList(); | 1056 g_browser_process->InitAutomationProviderList(); |
1057 DCHECK(list); | 1057 DCHECK(list); |
1058 list->AddProvider(automation); | 1058 list->AddProvider(automation); |
1059 } | 1059 } |
OLD | NEW |