| 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/tabs/tab_strip_controller.h" | 5 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" |
| 6 | 6 |
| 7 #import <QuartzCore/QuartzCore.h> | 7 #import <QuartzCore/QuartzCore.h> |
| 8 | 8 |
| 9 #include <cmath> | 9 #include <cmath> |
| 10 #include <limits> | 10 #include <limits> |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 44 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" | 44 #import "chrome/browser/ui/cocoa/tabs/tab_strip_view.h" |
| 45 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" | 45 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" |
| 46 #include "chrome/browser/ui/find_bar/find_bar.h" | 46 #include "chrome/browser/ui/find_bar/find_bar.h" |
| 47 #include "chrome/browser/ui/find_bar/find_bar_controller.h" | 47 #include "chrome/browser/ui/find_bar/find_bar_controller.h" |
| 48 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 48 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
| 49 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 49 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
| 50 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 50 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 51 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 51 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
| 52 #include "chrome/browser/ui/tabs/tab_utils.h" | 52 #include "chrome/browser/ui/tabs/tab_utils.h" |
| 53 #include "chrome/common/chrome_switches.h" | 53 #include "chrome/common/chrome_switches.h" |
| 54 #include "chrome/common/net/url_fixer_upper.h" | |
| 55 #include "chrome/common/pref_names.h" | 54 #include "chrome/common/pref_names.h" |
| 55 #include "components/url_fixer/url_fixer.h" |
| 56 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 56 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
| 57 #include "content/public/browser/navigation_controller.h" | 57 #include "content/public/browser/navigation_controller.h" |
| 58 #include "content/public/browser/user_metrics.h" | 58 #include "content/public/browser/user_metrics.h" |
| 59 #include "content/public/browser/web_contents.h" | 59 #include "content/public/browser/web_contents.h" |
| 60 #include "grit/generated_resources.h" | 60 #include "grit/generated_resources.h" |
| 61 #include "grit/theme_resources.h" | 61 #include "grit/theme_resources.h" |
| 62 #include "grit/ui_resources.h" | 62 #include "grit/ui_resources.h" |
| 63 #include "skia/ext/skia_utils_mac.h" | 63 #include "skia/ext/skia_utils_mac.h" |
| 64 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 64 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
| 65 #include "ui/base/cocoa/animation_utils.h" | 65 #include "ui/base/cocoa/animation_utils.h" |
| (...skipping 2005 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2071 if ([urls count] < 1) { | 2071 if ([urls count] < 1) { |
| 2072 NOTREACHED(); | 2072 NOTREACHED(); |
| 2073 return; | 2073 return; |
| 2074 } | 2074 } |
| 2075 | 2075 |
| 2076 //TODO(viettrungluu): dropping multiple URLs. | 2076 //TODO(viettrungluu): dropping multiple URLs. |
| 2077 if ([urls count] > 1) | 2077 if ([urls count] > 1) |
| 2078 NOTIMPLEMENTED(); | 2078 NOTIMPLEMENTED(); |
| 2079 | 2079 |
| 2080 // Get the first URL and fix it up. | 2080 // Get the first URL and fix it up. |
| 2081 GURL url(GURL(URLFixerUpper::FixupURL( | 2081 GURL url(GURL(url_fixer::FixupURL( |
| 2082 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string()))); | 2082 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string()))); |
| 2083 | 2083 |
| 2084 [self openURL:&url inView:view at:point]; | 2084 [self openURL:&url inView:view at:point]; |
| 2085 } | 2085 } |
| 2086 | 2086 |
| 2087 // (URLDropTargetController protocol) | 2087 // (URLDropTargetController protocol) |
| 2088 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 2088 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
| 2089 DCHECK_EQ(view, tabStripView_.get()); | 2089 DCHECK_EQ(view, tabStripView_.get()); |
| 2090 | 2090 |
| 2091 // If the input is plain text, classify the input and make the URL. | 2091 // If the input is plain text, classify the input and make the URL. |
| (...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2229 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { | 2229 NSView* GetSheetParentViewForWebContents(WebContents* web_contents) { |
| 2230 // View hierarchy of the contents view: | 2230 // View hierarchy of the contents view: |
| 2231 // NSView -- switchView, same for all tabs | 2231 // NSView -- switchView, same for all tabs |
| 2232 // +- NSView -- TabContentsController's view | 2232 // +- NSView -- TabContentsController's view |
| 2233 // +- TabContentsViewCocoa | 2233 // +- TabContentsViewCocoa |
| 2234 // | 2234 // |
| 2235 // Changing it? Do not forget to modify | 2235 // Changing it? Do not forget to modify |
| 2236 // -[TabStripController swapInTabAtIndex:] too. | 2236 // -[TabStripController swapInTabAtIndex:] too. |
| 2237 return [web_contents->GetNativeView() superview]; | 2237 return [web_contents->GetNativeView() superview]; |
| 2238 } | 2238 } |
| OLD | NEW |