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

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

Issue 10872034: Changing PluginPrefs to use PluginFinder's async interface. (Closed) Base URL: http://git.chromium.org/chromium/src.git@test_async
Patch Set: Fixed bug in chromeos loading the plugins page Created 8 years, 3 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
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/component_updater/flash_component_installer.h" 5 #include "chrome/browser/component_updater/flash_component_installer.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
158 kFlashPluginSwfExtension, 158 kFlashPluginSwfExtension,
159 kFlashPluginName); 159 kFlashPluginName);
160 plugin_info->mime_types.push_back(swf_mime_type); 160 plugin_info->mime_types.push_back(swf_mime_type);
161 webkit::WebPluginMimeType spl_mime_type(kFlashPluginSplMimeType, 161 webkit::WebPluginMimeType spl_mime_type(kFlashPluginSplMimeType,
162 kFlashPluginSplExtension, 162 kFlashPluginSplExtension,
163 kFlashPluginName); 163 kFlashPluginName);
164 plugin_info->mime_types.push_back(spl_mime_type); 164 plugin_info->mime_types.push_back(spl_mime_type);
165 return true; 165 return true;
166 } 166 }
167 167
168 void CanEnablePluginCallbackDoNothing(bool dummy) {
169 // Ignore the state-change check result.
170 }
171
168 // If it is a |fresh_install| we enable or disable it by default in some 172 // If it is a |fresh_install| we enable or disable it by default in some
169 // configurations. See IsPepperFlashEnabledByDefault() for more information. 173 // configurations. See IsPepperFlashEnabledByDefault() for more information.
170 void RegisterPepperFlashWithChrome(const FilePath& path, 174 void RegisterPepperFlashWithChrome(const FilePath& path,
171 const Version& version, 175 const Version& version,
172 bool fresh_install) { 176 bool fresh_install) {
173 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 177 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
174 content::PepperPluginInfo plugin_info; 178 content::PepperPluginInfo plugin_info;
175 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) 179 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info))
176 return; 180 return;
177 bool enable_by_default = IsPepperFlashEnabledByDefault(); 181 bool enable_by_default = IsPepperFlashEnabledByDefault();
178 if (fresh_install) 182 if (fresh_install)
179 PluginPrefs::EnablePluginGlobally(enable_by_default, plugin_info.path, 183 PluginPrefs::EnablePluginGlobally(
180 base::Bind(&base::DoNothing)); 184 enable_by_default,
185 plugin_info.path,
186 base::Bind(&CanEnablePluginCallbackDoNothing));
181 187
182 bool add_to_front = enable_by_default; 188 bool add_to_front = enable_by_default;
183 PluginService::GetInstance()->RegisterInternalPlugin( 189 PluginService::GetInstance()->RegisterInternalPlugin(
184 plugin_info.ToWebPluginInfo(), add_to_front); 190 plugin_info.ToWebPluginInfo(), add_to_front);
185 PluginService::GetInstance()->RefreshPlugins(); 191 PluginService::GetInstance()->RefreshPlugins();
186 } 192 }
187 193
188 // Returns true if this browser implements one of the interfaces given in 194 // Returns true if this browser implements one of the interfaces given in
189 // |interface_string|, which is a '|'-separated string of interface names. 195 // |interface_string|, which is a '|'-separated string of interface names.
190 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { 196 bool CheckPepperFlashInterfaceString(const std::string& interface_string) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 366 }
361 367
362 } // namespace 368 } // namespace
363 369
364 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { 370 void RegisterPepperFlashComponent(ComponentUpdateService* cus) {
365 #if defined(GOOGLE_CHROME_BUILD) 371 #if defined(GOOGLE_CHROME_BUILD)
366 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 372 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
367 base::Bind(&StartPepperFlashUpdateRegistration, cus)); 373 base::Bind(&StartPepperFlashUpdateRegistration, cus));
368 #endif 374 #endif
369 } 375 }
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/gview_request_interceptor_unittest.cc ('k') | chrome/browser/plugin_prefs.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698