OLD | NEW |
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 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" | 5 #import "chrome/browser/ui/cocoa/toolbar/toolbar_controller.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/mac/bundle_locations.h" | 9 #include "base/mac/bundle_locations.h" |
10 #include "base/mac/mac_util.h" | 10 #include "base/mac/mac_util.h" |
(...skipping 800 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
811 } | 811 } |
812 | 812 |
813 // TODO(viettrungluu): dropping multiple URLs? | 813 // TODO(viettrungluu): dropping multiple URLs? |
814 if ([urls count] > 1) | 814 if ([urls count] > 1) |
815 NOTIMPLEMENTED(); | 815 NOTIMPLEMENTED(); |
816 | 816 |
817 // Get the first URL and fix it up. | 817 // Get the first URL and fix it up. |
818 GURL url(URLFixerUpper::FixupURL( | 818 GURL url(URLFixerUpper::FixupURL( |
819 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())); | 819 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())); |
820 | 820 |
821 if (url.SchemeIs(content::kJavaScriptScheme)) { | 821 if (url.SchemeIs(url::kJavaScriptScheme)) { |
822 browser_->window()->GetLocationBar()->GetOmniboxView()->SetUserText( | 822 browser_->window()->GetLocationBar()->GetOmniboxView()->SetUserText( |
823 OmniboxView::StripJavascriptSchemas(base::UTF8ToUTF16(url.spec()))); | 823 OmniboxView::StripJavascriptSchemas(base::UTF8ToUTF16(url.spec()))); |
824 } | 824 } |
825 OpenURLParams params( | 825 OpenURLParams params( |
826 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); | 826 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); |
827 browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); | 827 browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); |
828 } | 828 } |
829 | 829 |
830 // (URLDropTargetController protocol) | 830 // (URLDropTargetController protocol) |
831 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 831 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
(...skipping 22 matching lines...) Expand all Loading... |
854 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 854 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
855 // Do nothing. | 855 // Do nothing. |
856 } | 856 } |
857 | 857 |
858 // (URLDropTargetController protocol) | 858 // (URLDropTargetController protocol) |
859 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 859 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
860 return drag_util::IsUnsupportedDropData(profile_, info); | 860 return drag_util::IsUnsupportedDropData(profile_, info); |
861 } | 861 } |
862 | 862 |
863 @end | 863 @end |
OLD | NEW |