| 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 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 598 return true; | 598 return true; |
| 599 } | 599 } |
| 600 return false; | 600 return false; |
| 601 } | 601 } |
| 602 | 602 |
| 603 bool BrowserInit::LaunchWithProfile::OpenApplicationWindow(Profile* profile) { | 603 bool BrowserInit::LaunchWithProfile::OpenApplicationWindow(Profile* profile) { |
| 604 std::string url_string, app_id; | 604 std::string url_string, app_id; |
| 605 if (!IsAppLaunch(&url_string, &app_id)) | 605 if (!IsAppLaunch(&url_string, &app_id)) |
| 606 return false; | 606 return false; |
| 607 | 607 |
| 608 // This can fail if the app_id is invalid. It can also fail if the | 608 // http://crbug.com/37548 |
| 609 // extension is external, and has not yet been installed. | 609 // TODO(rafaelw): There are two legitimate cases where the extensions |
| 610 // TODO(skerner): Do something reasonable here. Pop up a warning panel? | 610 // service could not be ready at this point which need to be handled: |
| 611 // 1) The locale has changed and the manifests stored in the preferences |
| 612 // need to be relocalized. |
| 613 // 2) An externally installed extension will be found and installed. |
| 614 // Note that this can also fail if the app_id is simply invalid. |
| 615 // TODO(rafaelw): Do something reasonable here. Pop up a warning panel? |
| 611 // Open an URL to the gallery page of the extension id? | 616 // Open an URL to the gallery page of the extension id? |
| 612 if (!app_id.empty()) | 617 if (!app_id.empty()) |
| 613 return Browser::OpenApplication(profile, app_id, NULL) != NULL; | 618 return Browser::OpenApplication(profile, app_id, NULL) != NULL; |
| 614 | 619 |
| 615 if (url_string.empty()) | 620 if (url_string.empty()) |
| 616 return false; | 621 return false; |
| 617 | 622 |
| 618 #if defined(OS_WIN) // Fix up Windows shortcuts. | 623 #if defined(OS_WIN) // Fix up Windows shortcuts. |
| 619 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); | 624 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); |
| 620 #endif | 625 #endif |
| (...skipping 401 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1022 scoped_refptr<AutomationProviderClass> automation = | 1027 scoped_refptr<AutomationProviderClass> automation = |
| 1023 new AutomationProviderClass(profile); | 1028 new AutomationProviderClass(profile); |
| 1024 automation->ConnectToChannel(channel_id); | 1029 automation->ConnectToChannel(channel_id); |
| 1025 automation->SetExpectedTabCount(expected_tabs); | 1030 automation->SetExpectedTabCount(expected_tabs); |
| 1026 | 1031 |
| 1027 AutomationProviderList* list = | 1032 AutomationProviderList* list = |
| 1028 g_browser_process->InitAutomationProviderList(); | 1033 g_browser_process->InitAutomationProviderList(); |
| 1029 DCHECK(list); | 1034 DCHECK(list); |
| 1030 list->AddProvider(automation); | 1035 list->AddProvider(automation); |
| 1031 } | 1036 } |
| OLD | NEW |