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