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

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

Issue 10831224: Add pepper permissions to WebPluginInfo (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.cc » ('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) 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
11 #include "base/base_paths.h" 11 #include "base/base_paths.h"
12 #include "base/bind.h" 12 #include "base/bind.h"
13 #include "base/compiler_specific.h" 13 #include "base/compiler_specific.h"
14 #include "base/file_path.h" 14 #include "base/file_path.h"
15 #include "base/file_util.h" 15 #include "base/file_util.h"
16 #include "base/logging.h" 16 #include "base/logging.h"
17 #include "base/path_service.h" 17 #include "base/path_service.h"
18 #include "base/string_split.h" 18 #include "base/string_split.h"
19 #include "base/string_util.h" 19 #include "base/string_util.h"
20 #include "base/stringprintf.h" 20 #include "base/stringprintf.h"
21 #include "base/values.h" 21 #include "base/values.h"
22 #include "base/version.h" 22 #include "base/version.h"
23 #include "build/build_config.h" 23 #include "build/build_config.h"
24 #include "chrome/browser/component_updater/component_updater_service.h" 24 #include "chrome/browser/component_updater/component_updater_service.h"
25 #include "chrome/browser/plugin_prefs.h"
25 #include "chrome/common/pepper_flash.h" 26 #include "chrome/common/pepper_flash.h"
26 #include "chrome/browser/plugin_prefs.h"
27 #include "chrome/common/chrome_constants.h" 27 #include "chrome/common/chrome_constants.h"
28 #include "chrome/common/chrome_paths.h" 28 #include "chrome/common/chrome_paths.h"
29 #include "chrome/common/pepper_flash.h"
29 #include "content/public/browser/browser_thread.h" 30 #include "content/public/browser/browser_thread.h"
30 #include "content/public/browser/plugin_service.h" 31 #include "content/public/browser/plugin_service.h"
31 #include "content/public/common/pepper_plugin_info.h" 32 #include "content/public/common/pepper_plugin_info.h"
32 #include "ppapi/c/private/ppb_pdf.h" 33 #include "ppapi/c/private/ppb_pdf.h"
33 #include "webkit/plugins/plugin_constants.h" 34 #include "webkit/plugins/plugin_constants.h"
34 #include "webkit/plugins/ppapi/plugin_module.h" 35 #include "webkit/plugins/ppapi/plugin_module.h"
35 36
36 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR. 37 #include "flapper_version.h" // In SHARED_INTERMEDIATE_DIR.
37 38
38 using content::BrowserThread; 39 using content::BrowserThread;
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
138 if (!flash_version.IsValid()) 139 if (!flash_version.IsValid())
139 return false; 140 return false;
140 const std::vector<uint16> ver_nums = flash_version.components(); 141 const std::vector<uint16> ver_nums = flash_version.components();
141 if (ver_nums.size() < 3) 142 if (ver_nums.size() < 3)
142 return false; 143 return false;
143 144
144 plugin_info->is_internal = false; 145 plugin_info->is_internal = false;
145 plugin_info->is_out_of_process = out_of_process; 146 plugin_info->is_out_of_process = out_of_process;
146 plugin_info->path = flash_path; 147 plugin_info->path = flash_path;
147 plugin_info->name = kFlashPluginName; 148 plugin_info->name = kFlashPluginName;
148 plugin_info->permissions = ppapi::PERMISSION_DEV | 149 plugin_info->permissions = kPepperFlashPermissions;
149 ppapi::PERMISSION_PRIVATE |
150 ppapi::PERMISSION_BYPASS_USER_GESTURE;
151 150
152 // The description is like "Shockwave Flash 10.2 r154". 151 // The description is like "Shockwave Flash 10.2 r154".
153 plugin_info->description = StringPrintf("%s %d.%d r%d", 152 plugin_info->description = StringPrintf("%s %d.%d r%d",
154 kFlashPluginName, ver_nums[0], ver_nums[1], ver_nums[2]); 153 kFlashPluginName, ver_nums[0], ver_nums[1], ver_nums[2]);
155 154
156 plugin_info->version = flash_version.GetString(); 155 plugin_info->version = flash_version.GetString();
157 156
158 webkit::WebPluginMimeType swf_mime_type(kFlashPluginSwfMimeType, 157 webkit::WebPluginMimeType swf_mime_type(kFlashPluginSwfMimeType,
159 kFlashPluginSwfExtension, 158 kFlashPluginSwfExtension,
160 kFlashPluginName); 159 kFlashPluginName);
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after
361 } 360 }
362 361
363 } // namespace 362 } // namespace
364 363
365 void RegisterPepperFlashComponent(ComponentUpdateService* cus) { 364 void RegisterPepperFlashComponent(ComponentUpdateService* cus) {
366 #if defined(GOOGLE_CHROME_BUILD) && !defined(FLAPPER_AVAILABLE) 365 #if defined(GOOGLE_CHROME_BUILD) && !defined(FLAPPER_AVAILABLE)
367 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE, 366 BrowserThread::PostTask(BrowserThread::FILE, FROM_HERE,
368 base::Bind(&StartPepperFlashUpdateRegistration, cus)); 367 base::Bind(&StartPepperFlashUpdateRegistration, cus));
369 #endif 368 #endif
370 } 369 }
OLDNEW
« no previous file with comments | « no previous file | chrome/common/chrome_content_client.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698