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 763 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
774 } | 774 } |
775 | 775 |
776 // TODO(viettrungluu): dropping multiple URLs? | 776 // TODO(viettrungluu): dropping multiple URLs? |
777 if ([urls count] > 1) | 777 if ([urls count] > 1) |
778 NOTIMPLEMENTED(); | 778 NOTIMPLEMENTED(); |
779 | 779 |
780 // Get the first URL and fix it up. | 780 // Get the first URL and fix it up. |
781 GURL url(URLFixerUpper::FixupURL( | 781 GURL url(URLFixerUpper::FixupURL( |
782 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())); | 782 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())); |
783 | 783 |
784 if (url.SchemeIs(chrome::kJavaScriptScheme)) { | 784 if (url.SchemeIs(content::kJavaScriptScheme)) { |
785 browser_->window()->GetLocationBar()->GetLocationEntry()->SetUserText( | 785 browser_->window()->GetLocationBar()->GetLocationEntry()->SetUserText( |
786 OmniboxView::StripJavascriptSchemas(UTF8ToUTF16(url.spec()))); | 786 OmniboxView::StripJavascriptSchemas(UTF8ToUTF16(url.spec()))); |
787 } | 787 } |
788 OpenURLParams params( | 788 OpenURLParams params( |
789 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); | 789 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); |
790 browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); | 790 browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); |
791 } | 791 } |
792 | 792 |
793 // (URLDropTargetController protocol) | 793 // (URLDropTargetController protocol) |
794 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 794 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
(...skipping 21 matching lines...) Expand all Loading... |
816 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 816 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
817 // Do nothing. | 817 // Do nothing. |
818 } | 818 } |
819 | 819 |
820 // (URLDropTargetController protocol) | 820 // (URLDropTargetController protocol) |
821 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 821 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
822 return drag_util::IsUnsupportedDropData(profile_, info); | 822 return drag_util::IsUnsupportedDropData(profile_, info); |
823 } | 823 } |
824 | 824 |
825 @end | 825 @end |
OLD | NEW |