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

Side by Side Diff: chrome/browser/component_updater/pepper_flash_component_installer.cc

Issue 2565043002: Add flags entry to enable Chrome OS component updates fature. (Closed)
Patch Set: Created 4 years 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 | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_features.h » ('j') | 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) 2013 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2013 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/component_updater/pepper_flash_component_installer.h" 5 #include "chrome/browser/component_updater/pepper_flash_component_installer.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <string> 10 #include <string>
(...skipping 27 matching lines...) Expand all
38 #include "components/component_updater/default_component_installer.h" 38 #include "components/component_updater/default_component_installer.h"
39 #include "components/update_client/update_client.h" 39 #include "components/update_client/update_client.h"
40 #include "components/update_client/update_client_errors.h" 40 #include "components/update_client/update_client_errors.h"
41 #include "content/public/browser/browser_thread.h" 41 #include "content/public/browser/browser_thread.h"
42 #include "content/public/browser/plugin_service.h" 42 #include "content/public/browser/plugin_service.h"
43 #include "content/public/common/content_constants.h" 43 #include "content/public/common/content_constants.h"
44 #include "content/public/common/pepper_plugin_info.h" 44 #include "content/public/common/pepper_plugin_info.h"
45 #include "ppapi/shared_impl/ppapi_permissions.h" 45 #include "ppapi/shared_impl/ppapi_permissions.h"
46 46
47 #if defined(OS_CHROMEOS) 47 #if defined(OS_CHROMEOS)
48 #include "base/feature_list.h"
49 #include "chrome/browser/chromeos/settings/cros_settings.h" 48 #include "chrome/browser/chromeos/settings/cros_settings.h"
50 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h" 49 #include "chrome/browser/ui/ash/system_tray_delegate_chromeos.h"
50 #include "chrome/common/chrome_features.h"
51 #include "chromeos/dbus/dbus_method_call_status.h" 51 #include "chromeos/dbus/dbus_method_call_status.h"
52 #include "chromeos/dbus/dbus_thread_manager.h" 52 #include "chromeos/dbus/dbus_thread_manager.h"
53 #include "chromeos/dbus/image_loader_client.h" 53 #include "chromeos/dbus/image_loader_client.h"
54 #include "content/public/browser/browser_thread.h" 54 #include "content/public/browser/browser_thread.h"
55 #elif defined(OS_LINUX) 55 #elif defined(OS_LINUX)
56 #include "chrome/common/component_flash_hint_file_linux.h" 56 #include "chrome/common/component_flash_hint_file_linux.h"
57 #endif // defined(OS_CHROMEOS) 57 #endif // defined(OS_CHROMEOS)
58 58
59 using content::BrowserThread; 59 using content::BrowserThread;
60 using content::PluginService; 60 using content::PluginService;
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
107 if (loader) { 107 if (loader) {
108 loader->RegisterComponent("PepperFlashPlayer", version, install_dir.value(), 108 loader->RegisterComponent("PepperFlashPlayer", version, install_dir.value(),
109 base::Bind(&LogRegistrationResult)); 109 base::Bind(&LogRegistrationResult));
110 } else { 110 } else {
111 LOG(ERROR) << "Failed to get ImageLoaderClient object."; 111 LOG(ERROR) << "Failed to get ImageLoaderClient object.";
112 } 112 }
113 } 113 }
114 114
115 // Determine whether or not to skip registering flash component updates. 115 // Determine whether or not to skip registering flash component updates.
116 bool SkipFlashRegistration(ComponentUpdateService* cus) { 116 bool SkipFlashRegistration(ComponentUpdateService* cus) {
117 const base::Feature kCrosCompUpdates { 117 if (!base::FeatureList::IsEnabled(features::kCrosCompUpdates))
118 "CrosCompUpdates", base::FEATURE_DISABLED_BY_DEFAULT
119 };
120 if (!base::FeatureList::IsEnabled(kCrosCompUpdates))
121 return true; 118 return true;
122 119
123 // If the version of Chrome is pinned on the device (probably via enterprise 120 // If the version of Chrome is pinned on the device (probably via enterprise
124 // policy), do not component update Flash player. 121 // policy), do not component update Flash player.
125 chromeos::CrosSettingsProvider::TrustedStatus status = 122 chromeos::CrosSettingsProvider::TrustedStatus status =
126 chromeos::CrosSettings::Get()->PrepareTrustedValues( 123 chromeos::CrosSettings::Get()->PrepareTrustedValues(
127 base::Bind(&RegisterPepperFlashComponent, cus)); 124 base::Bind(&RegisterPepperFlashComponent, cus));
128 125
129 // Only if the settings are trusted, read the update settings and allow them 126 // Only if the settings are trusted, read the update settings and allow them
130 // to disable Flash component updates. If the settings are untrusted, then we 127 // to disable Flash component updates. If the settings are untrusted, then we
(...skipping 242 matching lines...) Expand 10 before | Expand all | Expand 10 after
373 std::unique_ptr<ComponentInstallerTraits> traits( 370 std::unique_ptr<ComponentInstallerTraits> traits(
374 new FlashComponentInstallerTraits); 371 new FlashComponentInstallerTraits);
375 // |cus| will take ownership of |installer| during installer->Register(cus). 372 // |cus| will take ownership of |installer| during installer->Register(cus).
376 DefaultComponentInstaller* installer = 373 DefaultComponentInstaller* installer =
377 new DefaultComponentInstaller(std::move(traits)); 374 new DefaultComponentInstaller(std::move(traits));
378 installer->Register(cus, base::Closure()); 375 installer->Register(cus, base::Closure());
379 #endif // defined(GOOGLE_CHROME_BUILD) 376 #endif // defined(GOOGLE_CHROME_BUILD)
380 } 377 }
381 378
382 } // namespace component_updater 379 } // namespace component_updater
OLDNEW
« no previous file with comments | « chrome/browser/about_flags.cc ('k') | chrome/common/chrome_features.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698