OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/startup/startup_browser_creator_impl.h" | 5 #include "chrome/browser/ui/startup/startup_browser_creator_impl.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <vector> | 8 #include <vector> |
9 | 9 |
10 #include "apps/app_restore_service.h" | 10 #include "apps/app_restore_service.h" |
(...skipping 485 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
496 #if defined(OS_WIN) // Fix up Windows shortcuts. | 496 #if defined(OS_WIN) // Fix up Windows shortcuts. |
497 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); | 497 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); |
498 #endif | 498 #endif |
499 GURL url(url_string); | 499 GURL url(url_string); |
500 | 500 |
501 // Restrict allowed URLs for --app switch. | 501 // Restrict allowed URLs for --app switch. |
502 if (!url.is_empty() && url.is_valid()) { | 502 if (!url.is_empty() && url.is_valid()) { |
503 ChildProcessSecurityPolicy* policy = | 503 ChildProcessSecurityPolicy* policy = |
504 ChildProcessSecurityPolicy::GetInstance(); | 504 ChildProcessSecurityPolicy::GetInstance(); |
505 if (policy->IsWebSafeScheme(url.scheme()) || | 505 if (policy->IsWebSafeScheme(url.scheme()) || |
506 url.SchemeIs(content::kFileScheme)) { | 506 url.SchemeIs(url::kFileScheme)) { |
507 const extensions::Extension* extension = | 507 const extensions::Extension* extension = |
508 extensions::ExtensionRegistry::Get(profile) | 508 extensions::ExtensionRegistry::Get(profile) |
509 ->enabled_extensions().GetAppByURL(url); | 509 ->enabled_extensions().GetAppByURL(url); |
510 if (extension) { | 510 if (extension) { |
511 RecordCmdLineAppHistogram(extension->GetType()); | 511 RecordCmdLineAppHistogram(extension->GetType()); |
512 } else { | 512 } else { |
513 CoreAppLauncherHandler::RecordAppLaunchType( | 513 CoreAppLauncherHandler::RecordAppLaunchType( |
514 extension_misc::APP_LAUNCH_CMD_LINE_APP_LEGACY, | 514 extension_misc::APP_LAUNCH_CMD_LINE_APP_LEGACY, |
515 extensions::Manifest::TYPE_HOSTED_APP); | 515 extensions::Manifest::TYPE_HOSTED_APP); |
516 } | 516 } |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
927 // behavior is desired because completing or skipping the sync promo | 927 // behavior is desired because completing or skipping the sync promo |
928 // causes a redirect to the NTP. | 928 // causes a redirect to the NTP. |
929 if (!startup_urls->empty() && | 929 if (!startup_urls->empty() && |
930 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) | 930 startup_urls->at(0) == GURL(chrome::kChromeUINewTabURL)) |
931 startup_urls->at(0) = sync_promo_url; | 931 startup_urls->at(0) = sync_promo_url; |
932 else | 932 else |
933 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 933 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
934 } | 934 } |
935 } | 935 } |
936 } | 936 } |
OLD | NEW |