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/extensions/component_loader.h" | 5 #include "chrome/browser/extensions/component_loader.h" |
6 | 6 |
7 #include <string> | 7 #include <string> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/files/file_util.h" | 10 #include "base/files/file_util.h" |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
51 #include "content/public/browser/site_instance.h" | 51 #include "content/public/browser/site_instance.h" |
52 #include "content/public/browser/storage_partition.h" | 52 #include "content/public/browser/storage_partition.h" |
53 #include "extensions/browser/extensions_browser_client.h" | 53 #include "extensions/browser/extensions_browser_client.h" |
54 #include "storage/browser/fileapi/file_system_context.h" | 54 #include "storage/browser/fileapi/file_system_context.h" |
55 #endif | 55 #endif |
56 | 56 |
57 #if defined(ENABLE_APP_LIST) | 57 #if defined(ENABLE_APP_LIST) |
58 #include "chrome/grit/chromium_strings.h" | 58 #include "chrome/grit/chromium_strings.h" |
59 #endif | 59 #endif |
60 | 60 |
61 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS) | |
62 #include "chrome/browser/ui/app_list/google_now_extension.h" | |
63 #endif | |
64 | |
61 using content::BrowserThread; | 65 using content::BrowserThread; |
62 | 66 |
63 namespace extensions { | 67 namespace extensions { |
64 | 68 |
65 namespace { | 69 namespace { |
66 | 70 |
67 static bool enable_background_extensions_during_testing = false; | 71 static bool enable_background_extensions_during_testing = false; |
68 | 72 |
69 std::string GenerateId(const base::DictionaryValue* manifest, | 73 std::string GenerateId(const base::DictionaryValue* manifest, |
70 const base::FilePath& path) { | 74 const base::FilePath& path) { |
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
607 | 611 |
608 bool enabled_via_field_trial = | 612 bool enabled_via_field_trial = |
609 field_trial_result.compare(0, enable_prefix.length(), enable_prefix) == 0; | 613 field_trial_result.compare(0, enable_prefix.length(), enable_prefix) == 0; |
610 | 614 |
611 // Enable the feature on trybots and trunk builds. | 615 // Enable the feature on trybots and trunk builds. |
612 bool enabled_via_trunk_build = | 616 bool enabled_via_trunk_build = |
613 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN; | 617 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN; |
614 | 618 |
615 bool enabled = enabled_via_field_trial || enabled_via_trunk_build; | 619 bool enabled = enabled_via_field_trial || enabled_via_trunk_build; |
616 | 620 |
621 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS) | |
622 // Don't load if newer trial is running (== new extension id is available). | |
623 std::string google_now_extension_id; | |
robliao
2015/02/19 06:06:53
OPTIONAL: Could rename to ignored_extension_id.
skare_
2015/02/19 15:20:28
Done.
| |
624 if (GetGoogleNowExtensionId(&google_now_extension_id)) { | |
625 enabled = false; | |
626 } | |
627 #endif | |
628 | |
617 if (!skip_session_components && enabled) { | 629 if (!skip_session_components && enabled) { |
618 Add(IDR_GOOGLE_NOW_MANIFEST, | 630 Add(IDR_GOOGLE_NOW_MANIFEST, |
619 base::FilePath(FILE_PATH_LITERAL("google_now"))); | 631 base::FilePath(FILE_PATH_LITERAL("google_now"))); |
620 } | 632 } |
621 #endif | 633 #endif |
622 | 634 |
623 #if defined(GOOGLE_CHROME_BUILD) | 635 #if defined(GOOGLE_CHROME_BUILD) |
624 #if !defined(OS_CHROMEOS) // http://crbug.com/314799 | 636 #if !defined(OS_CHROMEOS) // http://crbug.com/314799 |
625 AddNetworkSpeechSynthesisExtension(); | 637 AddNetworkSpeechSynthesisExtension(); |
626 #endif | 638 #endif |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
662 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); | 674 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); |
663 storage::FileSystemContext* file_system_context = | 675 storage::FileSystemContext* file_system_context = |
664 content::BrowserContext::GetStoragePartitionForSite( | 676 content::BrowserContext::GetStoragePartitionForSite( |
665 off_the_record_context, site)->GetFileSystemContext(); | 677 off_the_record_context, site)->GetFileSystemContext(); |
666 file_system_context->EnableTemporaryFileSystemInIncognito(); | 678 file_system_context->EnableTemporaryFileSystemInIncognito(); |
667 } | 679 } |
668 #endif | 680 #endif |
669 } | 681 } |
670 | 682 |
671 } // namespace extensions | 683 } // namespace extensions |
OLD | NEW |