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

Side by Side Diff: chrome/browser/ui/cocoa/drag_util.mm

Issue 9006036: Create an API around PluginService and use it from Chrome. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 9 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 #import "chrome/browser/ui/cocoa/drag_util.h" 5 #import "chrome/browser/ui/cocoa/drag_util.h"
6 6
7 #include "base/file_path.h" 7 #include "base/file_path.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "content/browser/plugin_service.h" 9 #include "content/public/browser/plugin_service.h"
10 #include "content/public/common/url_constants.h" 10 #include "content/public/common/url_constants.h"
11 #include "googleurl/src/gurl.h" 11 #include "googleurl/src/gurl.h"
12 #include "ipc/ipc_message.h"
12 #include "net/base/mime_util.h" 13 #include "net/base/mime_util.h"
13 #include "net/base/net_util.h" 14 #include "net/base/net_util.h"
14 #import "third_party/mozilla/NSPasteboard+Utils.h" 15 #import "third_party/mozilla/NSPasteboard+Utils.h"
15 #import "ui/base/dragdrop/cocoa_dnd_util.h" 16 #import "ui/base/dragdrop/cocoa_dnd_util.h"
17 #include "webkit/plugins/webplugininfo.h"
18
19 using content::PluginService;
16 20
17 namespace drag_util { 21 namespace drag_util {
18 22
19 namespace { 23 namespace {
20 24
21 BOOL IsSupportedFileURL(Profile* profile, const GURL& url) { 25 BOOL IsSupportedFileURL(Profile* profile, const GURL& url) {
22 FilePath full_path; 26 FilePath full_path;
23 net::FileURLToFilePath(url, &full_path); 27 net::FileURLToFilePath(url, &full_path);
24 28
25 std::string mime_type; 29 std::string mime_type;
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
64 GURL url = GetFileURLFromDropData(info); 68 GURL url = GetFileURLFromDropData(info);
65 if (!url.is_empty()) { 69 if (!url.is_empty()) {
66 // If dragging a file, only allow dropping supported file types (that the 70 // If dragging a file, only allow dropping supported file types (that the
67 // web view can display). 71 // web view can display).
68 return !IsSupportedFileURL(profile, url); 72 return !IsSupportedFileURL(profile, url);
69 } 73 }
70 return NO; 74 return NO;
71 } 75 }
72 76
73 } // namespace drag_util 77 } // namespace drag_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698