Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(391)

Side by Side Diff: chrome/browser/extensions/component_loader.cc

Issue 936203002: Disable notifications extension in component loader if launcher field trial is running (ChromeOS on… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
52 #include "content/public/browser/site_instance.h" 52 #include "content/public/browser/site_instance.h"
53 #include "content/public/browser/storage_partition.h" 53 #include "content/public/browser/storage_partition.h"
54 #include "extensions/browser/extensions_browser_client.h" 54 #include "extensions/browser/extensions_browser_client.h"
55 #include "storage/browser/fileapi/file_system_context.h" 55 #include "storage/browser/fileapi/file_system_context.h"
56 #endif 56 #endif
57 57
58 #if defined(ENABLE_APP_LIST) 58 #if defined(ENABLE_APP_LIST)
59 #include "chrome/grit/chromium_strings.h" 59 #include "chrome/grit/chromium_strings.h"
60 #endif 60 #endif
61 61
62 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS)
63 #include "chrome/browser/ui/app_list/google_now_extension.h"
64 #endif
65
62 using content::BrowserThread; 66 using content::BrowserThread;
63 67
64 namespace extensions { 68 namespace extensions {
65 69
66 namespace { 70 namespace {
67 71
68 static bool enable_background_extensions_during_testing = false; 72 static bool enable_background_extensions_during_testing = false;
69 73
70 std::string GenerateId(const base::DictionaryValue* manifest, 74 std::string GenerateId(const base::DictionaryValue* manifest,
71 const base::FilePath& path) { 75 const base::FilePath& path) {
(...skipping 536 matching lines...) Expand 10 before | Expand all | Expand 10 after
608 612
609 bool enabled_via_field_trial = 613 bool enabled_via_field_trial =
610 field_trial_result.compare(0, enable_prefix.length(), enable_prefix) == 0; 614 field_trial_result.compare(0, enable_prefix.length(), enable_prefix) == 0;
611 615
612 // Enable the feature on trybots and trunk builds. 616 // Enable the feature on trybots and trunk builds.
613 bool enabled_via_trunk_build = 617 bool enabled_via_trunk_build =
614 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN; 618 chrome::VersionInfo::GetChannel() == chrome::VersionInfo::CHANNEL_UNKNOWN;
615 619
616 bool enabled = enabled_via_field_trial || enabled_via_trunk_build; 620 bool enabled = enabled_via_field_trial || enabled_via_trunk_build;
617 621
622 #if defined(ENABLE_APP_LIST) && defined(OS_CHROMEOS)
623 // Don't load if newer trial is running (== new extension id is available).
624 std::string ignored_extension_id;
625 if (GetGoogleNowExtensionId(&ignored_extension_id)) {
626 enabled = false;
627 }
628 #endif
629
618 if (!skip_session_components && enabled) { 630 if (!skip_session_components && enabled) {
619 Add(IDR_GOOGLE_NOW_MANIFEST, 631 Add(IDR_GOOGLE_NOW_MANIFEST,
620 base::FilePath(FILE_PATH_LITERAL("google_now"))); 632 base::FilePath(FILE_PATH_LITERAL("google_now")));
621 } 633 }
622 #endif 634 #endif
623 635
624 #if defined(GOOGLE_CHROME_BUILD) 636 #if defined(GOOGLE_CHROME_BUILD)
625 #if !defined(OS_CHROMEOS) // http://crbug.com/314799 637 #if !defined(OS_CHROMEOS) // http://crbug.com/314799
626 AddNetworkSpeechSynthesisExtension(); 638 AddNetworkSpeechSynthesisExtension();
627 #endif 639 #endif
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after
661 off_the_record_context, Extension::GetBaseURLFromExtensionId(id)); 673 off_the_record_context, Extension::GetBaseURLFromExtensionId(id));
662 storage::FileSystemContext* file_system_context = 674 storage::FileSystemContext* file_system_context =
663 content::BrowserContext::GetStoragePartitionForSite( 675 content::BrowserContext::GetStoragePartitionForSite(
664 off_the_record_context, site)->GetFileSystemContext(); 676 off_the_record_context, site)->GetFileSystemContext();
665 file_system_context->EnableTemporaryFileSystemInIncognito(); 677 file_system_context->EnableTemporaryFileSystemInIncognito();
666 } 678 }
667 #endif 679 #endif
668 } 680 }
669 681
670 } // namespace extensions 682 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698