| 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/foundation_util.h" | 10 #include "base/mac/foundation_util.h" |
| (...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 47 #import "chrome/browser/ui/cocoa/view_id_util.h" | 47 #import "chrome/browser/ui/cocoa/view_id_util.h" |
| 48 #include "chrome/browser/ui/tabs/tab_strip_model.h" | 48 #include "chrome/browser/ui/tabs/tab_strip_model.h" |
| 49 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" | 49 #include "chrome/browser/ui/toolbar/app_menu_icon_controller.h" |
| 50 #include "chrome/browser/ui/toolbar/app_menu_model.h" | 50 #include "chrome/browser/ui/toolbar/app_menu_model.h" |
| 51 #include "chrome/common/pref_names.h" | 51 #include "chrome/common/pref_names.h" |
| 52 #include "chrome/grit/chromium_strings.h" | 52 #include "chrome/grit/chromium_strings.h" |
| 53 #include "chrome/grit/generated_resources.h" | 53 #include "chrome/grit/generated_resources.h" |
| 54 #include "components/metrics/proto/omnibox_event.pb.h" | 54 #include "components/metrics/proto/omnibox_event.pb.h" |
| 55 #include "components/omnibox/browser/autocomplete_classifier.h" | 55 #include "components/omnibox/browser/autocomplete_classifier.h" |
| 56 #include "components/omnibox/browser/autocomplete_match.h" | 56 #include "components/omnibox/browser/autocomplete_match.h" |
| 57 #include "components/omnibox/browser/omnibox_edit_model.h" |
| 57 #include "components/omnibox/browser/omnibox_view.h" | 58 #include "components/omnibox/browser/omnibox_view.h" |
| 58 #include "components/prefs/pref_service.h" | 59 #include "components/prefs/pref_service.h" |
| 59 #include "components/search_engines/template_url_service.h" | 60 #include "components/search_engines/template_url_service.h" |
| 60 #include "components/url_formatter/url_fixer.h" | 61 #include "components/url_formatter/url_fixer.h" |
| 61 #include "content/public/browser/web_contents.h" | 62 #include "content/public/browser/web_contents.h" |
| 62 #include "grit/components_strings.h" | 63 #include "grit/components_strings.h" |
| 63 #include "grit/theme_resources.h" | 64 #include "grit/theme_resources.h" |
| 64 #import "ui/base/cocoa/menu_controller.h" | 65 #import "ui/base/cocoa/menu_controller.h" |
| 65 #import "ui/base/cocoa/nsview_additions.h" | 66 #import "ui/base/cocoa/nsview_additions.h" |
| 66 #include "ui/base/l10n/l10n_util.h" | 67 #include "ui/base/l10n/l10n_util.h" |
| (...skipping 1041 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1108 } | 1109 } |
| 1109 | 1110 |
| 1110 - (NSView*)appMenuButton { | 1111 - (NSView*)appMenuButton { |
| 1111 return appMenuButton_; | 1112 return appMenuButton_; |
| 1112 } | 1113 } |
| 1113 | 1114 |
| 1114 - (AppMenuController*)appMenuController { | 1115 - (AppMenuController*)appMenuController { |
| 1115 return appMenuController_.get(); | 1116 return appMenuController_.get(); |
| 1116 } | 1117 } |
| 1117 | 1118 |
| 1119 - (BOOL)isLocationBarFocused { |
| 1120 OmniboxEditModel* model = locationBarView_->GetOmniboxView()->model(); |
| 1121 return model->has_focus(); |
| 1122 } |
| 1123 |
| 1118 // (URLDropTargetController protocol) | 1124 // (URLDropTargetController protocol) |
| 1119 - (void)dropURLs:(NSArray*)urls inView:(NSView*)view at:(NSPoint)point { | 1125 - (void)dropURLs:(NSArray*)urls inView:(NSView*)view at:(NSPoint)point { |
| 1120 // TODO(viettrungluu): This code is more or less copied from the code in | 1126 // TODO(viettrungluu): This code is more or less copied from the code in |
| 1121 // |TabStripController|. I'll refactor this soon to make it common and expand | 1127 // |TabStripController|. I'll refactor this soon to make it common and expand |
| 1122 // its capabilities (e.g., allow text DnD). | 1128 // its capabilities (e.g., allow text DnD). |
| 1123 if ([urls count] < 1) { | 1129 if ([urls count] < 1) { |
| 1124 NOTREACHED(); | 1130 NOTREACHED(); |
| 1125 return; | 1131 return; |
| 1126 } | 1132 } |
| 1127 | 1133 |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1169 - (void)hideDropURLsIndicatorInView:(NSView*)view { | 1175 - (void)hideDropURLsIndicatorInView:(NSView*)view { |
| 1170 // Do nothing. | 1176 // Do nothing. |
| 1171 } | 1177 } |
| 1172 | 1178 |
| 1173 // (URLDropTargetController protocol) | 1179 // (URLDropTargetController protocol) |
| 1174 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { | 1180 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { |
| 1175 return drag_util::IsUnsupportedDropData(profile_, info); | 1181 return drag_util::IsUnsupportedDropData(profile_, info); |
| 1176 } | 1182 } |
| 1177 | 1183 |
| 1178 @end | 1184 @end |
| OLD | NEW |