| 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 758 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
|  769   // TODO(viettrungluu): dropping multiple URLs? |  769   // TODO(viettrungluu): dropping multiple URLs? | 
|  770   if ([urls count] > 1) |  770   if ([urls count] > 1) | 
|  771     NOTIMPLEMENTED(); |  771     NOTIMPLEMENTED(); | 
|  772  |  772  | 
|  773   // Get the first URL and fix it up. |  773   // Get the first URL and fix it up. | 
|  774   GURL url(URLFixerUpper::FixupURL( |  774   GURL url(URLFixerUpper::FixupURL( | 
|  775       base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())); |  775       base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string())); | 
|  776  |  776  | 
|  777   if (url.SchemeIs(content::kJavaScriptScheme)) { |  777   if (url.SchemeIs(content::kJavaScriptScheme)) { | 
|  778     browser_->window()->GetLocationBar()->GetOmniboxView()->SetUserText( |  778     browser_->window()->GetLocationBar()->GetOmniboxView()->SetUserText( | 
|  779           OmniboxView::StripJavascriptSchemas(UTF8ToUTF16(url.spec()))); |  779           OmniboxView::StripJavascriptSchemas(base::UTF8ToUTF16(url.spec()))); | 
|  780   } |  780   } | 
|  781   OpenURLParams params( |  781   OpenURLParams params( | 
|  782       url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); |  782       url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); | 
|  783   browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); |  783   browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); | 
|  784 } |  784 } | 
|  785  |  785  | 
|  786 // (URLDropTargetController protocol) |  786 // (URLDropTargetController protocol) | 
|  787 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |  787 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 
|  788   // TODO(viettrungluu): This code is more or less copied from the code in |  788   // TODO(viettrungluu): This code is more or less copied from the code in | 
|  789   // |TabStripController|. I'll refactor this soon to make it common and expand |  789   // |TabStripController|. I'll refactor this soon to make it common and expand | 
| (...skipping 19 matching lines...) Expand all  Loading... | 
|  809 - (void)hideDropURLsIndicatorInView:(NSView*)view { |  809 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 
|  810   // Do nothing. |  810   // Do nothing. | 
|  811 } |  811 } | 
|  812  |  812  | 
|  813 // (URLDropTargetController protocol) |  813 // (URLDropTargetController protocol) | 
|  814 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |  814 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 
|  815   return drag_util::IsUnsupportedDropData(profile_, info); |  815   return drag_util::IsUnsupportedDropData(profile_, info); | 
|  816 } |  816 } | 
|  817  |  817  | 
|  818 @end |  818 @end | 
| OLD | NEW |