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

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 bauerb's review comments 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) {
Bernhard Bauer 2012/08/29 16:53:21 We could add a comment that we're fine with ignori
ibraaaa 2012/08/29 17:37:53 Done.
169 }
170
168 // If it is a |fresh_install| we enable or disable it by default in some 171 // If it is a |fresh_install| we enable or disable it by default in some
169 // configurations. See IsPepperFlashEnabledByDefault() for more information. 172 // configurations. See IsPepperFlashEnabledByDefault() for more information.
170 void RegisterPepperFlashWithChrome(const FilePath& path, 173 void RegisterPepperFlashWithChrome(const FilePath& path,
171 const Version& version, 174 const Version& version,
172 bool fresh_install) { 175 bool fresh_install) {
173 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI)); 176 DCHECK(BrowserThread::CurrentlyOn(BrowserThread::UI));
174 content::PepperPluginInfo plugin_info; 177 content::PepperPluginInfo plugin_info;
175 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info)) 178 if (!MakePepperFlashPluginInfo(path, version, true, &plugin_info))
176 return; 179 return;
177 bool enable_by_default = IsPepperFlashEnabledByDefault(); 180 bool enable_by_default = IsPepperFlashEnabledByDefault();
178 if (fresh_install) 181 if (fresh_install)
179 PluginPrefs::EnablePluginGlobally(enable_by_default, plugin_info.path, 182 PluginPrefs::EnablePluginGlobally(
180 base::Bind(&base::DoNothing)); 183 enable_by_default,
184 plugin_info.path,
185 base::Bind(&CanEnablePluginCallbackDoNothing));
181 186
182 bool add_to_front = enable_by_default; 187 bool add_to_front = enable_by_default;
183 PluginService::GetInstance()->RegisterInternalPlugin( 188 PluginService::GetInstance()->RegisterInternalPlugin(
184 plugin_info.ToWebPluginInfo(), add_to_front); 189 plugin_info.ToWebPluginInfo(), add_to_front);
185 PluginService::GetInstance()->RefreshPlugins(); 190 PluginService::GetInstance()->RefreshPlugins();
186 } 191 }
187 192
188 // Returns true if this browser implements one of the interfaces given in 193 // Returns true if this browser implements one of the interfaces given in
189 // |interface_string|, which is a '|'-separated string of interface names. 194 // |interface_string|, which is a '|'-separated string of interface names.
190 bool CheckPepperFlashInterfaceString(const std::string& interface_string) { 195 bool CheckPepperFlashInterfaceString(const std::string& interface_string) {
(...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after
360 } 365 }
361 366
362 } // namespace 367 } // namespace
363 368
364 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { 369 void RegisterPepperFlashComponent(ComponentUpdateService* cus) {
365 #if defined(GOOGLE_CHROME_BUILD) 370 #if defined(GOOGLE_CHROME_BUILD)
366 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 371 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
367 base::Bind(&StartPepperFlashUpdateRegistration, cus)); 372 base::Bind(&StartPepperFlashUpdateRegistration, cus));
368 #endif 373 #endif
369 } 374 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698