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

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

Issue 273193004: Move some content url constants to /url. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 7 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) 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/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "chrome/browser/profiles/profile.h" 8 #include "chrome/browser/profiles/profile.h"
9 #include "content/public/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"
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after
51 } // namespace 51 } // namespace
52 52
53 GURL GetFileURLFromDropData(id<NSDraggingInfo> info) { 53 GURL GetFileURLFromDropData(id<NSDraggingInfo> info) {
54 if ([[info draggingPasteboard] containsURLData]) { 54 if ([[info draggingPasteboard] containsURLData]) {
55 GURL url; 55 GURL url;
56 ui::PopulateURLAndTitleFromPasteboard(&url, 56 ui::PopulateURLAndTitleFromPasteboard(&url,
57 NULL, 57 NULL,
58 [info draggingPasteboard], 58 [info draggingPasteboard],
59 YES); 59 YES);
60 60
61 if (url.SchemeIs(content::kFileScheme)) 61 if (url.SchemeIs(url::kFileScheme))
62 return url; 62 return url;
63 } 63 }
64 return GURL(); 64 return GURL();
65 } 65 }
66 66
67 BOOL IsUnsupportedDropData(Profile* profile, id<NSDraggingInfo> info) { 67 BOOL IsUnsupportedDropData(Profile* profile, id<NSDraggingInfo> info) {
68 GURL url = GetFileURLFromDropData(info); 68 GURL url = GetFileURLFromDropData(info);
69 if (!url.is_empty()) { 69 if (!url.is_empty()) {
70 // 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
71 // web view can display). 71 // web view can display).
72 return !IsSupportedFileURL(profile, url); 72 return !IsSupportedFileURL(profile, url);
73 } 73 }
74 return NO; 74 return NO;
75 } 75 }
76 76
77 } // namespace drag_util 77 } // namespace drag_util
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698