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 491 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
502 #if defined(OS_WIN) // Fix up Windows shortcuts. | 502 #if defined(OS_WIN) // Fix up Windows shortcuts. |
503 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); | 503 ReplaceSubstringsAfterOffset(&url_string, 0, "\\x", "%"); |
504 #endif | 504 #endif |
505 GURL url(url_string); | 505 GURL url(url_string); |
506 | 506 |
507 // Restrict allowed URLs for --app switch. | 507 // Restrict allowed URLs for --app switch. |
508 if (!url.is_empty() && url.is_valid()) { | 508 if (!url.is_empty() && url.is_valid()) { |
509 ChildProcessSecurityPolicy* policy = | 509 ChildProcessSecurityPolicy* policy = |
510 ChildProcessSecurityPolicy::GetInstance(); | 510 ChildProcessSecurityPolicy::GetInstance(); |
511 if (policy->IsWebSafeScheme(url.scheme()) || | 511 if (policy->IsWebSafeScheme(url.scheme()) || |
512 url.SchemeIs(content::kFileScheme)) { | 512 url.SchemeIs(url::kFileScheme)) { |
513 const extensions::Extension* extension = | 513 const extensions::Extension* extension = |
514 extensions::ExtensionRegistry::Get(profile) | 514 extensions::ExtensionRegistry::Get(profile) |
515 ->enabled_extensions().GetAppByURL(url); | 515 ->enabled_extensions().GetAppByURL(url); |
516 if (extension) { | 516 if (extension) { |
517 RecordCmdLineAppHistogram(extension->GetType()); | 517 RecordCmdLineAppHistogram(extension->GetType()); |
518 } else { | 518 } else { |
519 CoreAppLauncherHandler::RecordAppLaunchType( | 519 CoreAppLauncherHandler::RecordAppLaunchType( |
520 extension_misc::APP_LAUNCH_CMD_LINE_APP_LEGACY, | 520 extension_misc::APP_LAUNCH_CMD_LINE_APP_LEGACY, |
521 extensions::Manifest::TYPE_HOSTED_APP); | 521 extensions::Manifest::TYPE_HOSTED_APP); |
522 } | 522 } |
(...skipping 410 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
933 // If the first URL is the NTP, replace it with the sync promo. This | 933 // If the first URL is the NTP, replace it with the sync promo. This |
934 // behavior is desired because completing or skipping the sync promo | 934 // behavior is desired because completing or skipping the sync promo |
935 // causes a redirect to the NTP. | 935 // causes a redirect to the NTP. |
936 if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0))) | 936 if (!startup_urls->empty() && IsNewTabURL(profile_, startup_urls->at(0))) |
937 startup_urls->at(0) = sync_promo_url; | 937 startup_urls->at(0) = sync_promo_url; |
938 else | 938 else |
939 startup_urls->insert(startup_urls->begin(), sync_promo_url); | 939 startup_urls->insert(startup_urls->begin(), sync_promo_url); |
940 } | 940 } |
941 } | 941 } |
942 } | 942 } |
OLD | NEW |