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 #include "chrome/browser/ui/find_bar/find_tab_helper.h" | 44 #include "chrome/browser/ui/find_bar/find_tab_helper.h" |
45 #include "chrome/browser/ui/tabs/tab_menu_model.h" | 45 #include "chrome/browser/ui/tabs/tab_menu_model.h" |
46 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 46 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
47 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" | 47 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" |
48 #include "chrome/browser/ui/tabs/tab_utils.h" | 48 #include "chrome/browser/ui/tabs/tab_utils.h" |
49 #include "chrome/common/chrome_switches.h" | 49 #include "chrome/common/chrome_switches.h" |
50 #include "chrome/grit/generated_resources.h" | 50 #include "chrome/grit/generated_resources.h" |
51 #include "components/metrics/proto/omnibox_event.pb.h" | 51 #include "components/metrics/proto/omnibox_event.pb.h" |
52 #include "components/omnibox/browser/autocomplete_classifier.h" | 52 #include "components/omnibox/browser/autocomplete_classifier.h" |
53 #include "components/omnibox/browser/autocomplete_match.h" | 53 #include "components/omnibox/browser/autocomplete_match.h" |
54 #include "components/url_fixer/url_fixer.h" | 54 #include "components/url_formatter/url_fixer.h" |
55 #include "components/web_modal/web_contents_modal_dialog_manager.h" | 55 #include "components/web_modal/web_contents_modal_dialog_manager.h" |
56 #include "content/public/browser/navigation_controller.h" | 56 #include "content/public/browser/navigation_controller.h" |
57 #include "content/public/browser/user_metrics.h" | 57 #include "content/public/browser/user_metrics.h" |
58 #include "content/public/browser/web_contents.h" | 58 #include "content/public/browser/web_contents.h" |
59 #include "grit/theme_resources.h" | 59 #include "grit/theme_resources.h" |
60 #include "skia/ext/skia_utils_mac.h" | 60 #include "skia/ext/skia_utils_mac.h" |
61 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" | 61 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h
" |
62 #include "ui/base/cocoa/animation_utils.h" | 62 #include "ui/base/cocoa/animation_utils.h" |
63 #import "ui/base/cocoa/tracking_area.h" | 63 #import "ui/base/cocoa/tracking_area.h" |
64 #include "ui/base/l10n/l10n_util.h" | 64 #include "ui/base/l10n/l10n_util.h" |
(...skipping 2021 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2086 if ([urls count] < 1) { | 2086 if ([urls count] < 1) { |
2087 NOTREACHED(); | 2087 NOTREACHED(); |
2088 return; | 2088 return; |
2089 } | 2089 } |
2090 | 2090 |
2091 //TODO(viettrungluu): dropping multiple URLs. | 2091 //TODO(viettrungluu): dropping multiple URLs. |
2092 if ([urls count] > 1) | 2092 if ([urls count] > 1) |
2093 NOTIMPLEMENTED(); | 2093 NOTIMPLEMENTED(); |
2094 | 2094 |
2095 // Get the first URL and fix it up. | 2095 // Get the first URL and fix it up. |
2096 GURL url(GURL(url_fixer::FixupURL( | 2096 GURL url(GURL(url_formatter::FixupURL( |
2097 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string()))); | 2097 base::SysNSStringToUTF8([urls objectAtIndex:0]), std::string()))); |
2098 | 2098 |
2099 [self openURL:&url inView:view at:point]; | 2099 [self openURL:&url inView:view at:point]; |
2100 } | 2100 } |
2101 | 2101 |
2102 // (URLDropTargetController protocol) | 2102 // (URLDropTargetController protocol) |
2103 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { | 2103 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { |
2104 DCHECK_EQ(view, tabStripView_.get()); | 2104 DCHECK_EQ(view, tabStripView_.get()); |
2105 | 2105 |
2106 // If the input is plain text, classify the input and make the URL. | 2106 // If the input is plain text, classify the input and make the URL. |
(...skipping 176 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2283 forButtonState:image_button_cell::kHoverStateBackground]; | 2283 forButtonState:image_button_cell::kHoverStateBackground]; |
2284 } else { | 2284 } else { |
2285 [[newTabButton_ cell] setImage:nil | 2285 [[newTabButton_ cell] setImage:nil |
2286 forButtonState:image_button_cell::kDefaultStateBackground]; | 2286 forButtonState:image_button_cell::kDefaultStateBackground]; |
2287 [[newTabButton_ cell] setImage:nil | 2287 [[newTabButton_ cell] setImage:nil |
2288 forButtonState:image_button_cell::kHoverStateBackground]; | 2288 forButtonState:image_button_cell::kHoverStateBackground]; |
2289 } | 2289 } |
2290 } | 2290 } |
2291 | 2291 |
2292 @end | 2292 @end |
OLD | NEW |