Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(21)

Side by Side Diff: chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm

Issue 343523003: Remove AutocompleteInput Type and PageClassification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: fix Created 6 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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"
11 #include "base/memory/singleton.h" 11 #include "base/memory/singleton.h"
12 #include "base/prefs/pref_service.h" 12 #include "base/prefs/pref_service.h"
13 #include "base/strings/string_util.h" 13 #include "base/strings/string_util.h"
14 #include "base/strings/sys_string_conversions.h" 14 #include "base/strings/sys_string_conversions.h"
15 #include "base/strings/utf_string_conversions.h" 15 #include "base/strings/utf_string_conversions.h"
16 #include "chrome/app/chrome_command_ids.h" 16 #include "chrome/app/chrome_command_ids.h"
17 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 17 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
18 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 18 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
19 #include "chrome/browser/autocomplete/autocomplete_input.h"
20 #include "chrome/browser/autocomplete/autocomplete_match.h" 19 #include "chrome/browser/autocomplete/autocomplete_match.h"
21 #include "chrome/browser/chrome_notification_types.h" 20 #include "chrome/browser/chrome_notification_types.h"
22 #include "chrome/browser/command_updater.h" 21 #include "chrome/browser/command_updater.h"
23 #include "chrome/browser/profiles/profile.h" 22 #include "chrome/browser/profiles/profile.h"
24 #include "chrome/browser/search/search.h" 23 #include "chrome/browser/search/search.h"
25 #include "chrome/browser/search_engines/template_url_service.h" 24 #include "chrome/browser/search_engines/template_url_service.h"
26 #include "chrome/browser/themes/theme_service.h" 25 #include "chrome/browser/themes/theme_service.h"
27 #include "chrome/browser/ui/browser.h" 26 #include "chrome/browser/ui/browser.h"
28 #include "chrome/browser/ui/browser_window.h" 27 #include "chrome/browser/ui/browser_window.h"
29 #import "chrome/browser/ui/cocoa/background_gradient_view.h" 28 #import "chrome/browser/ui/cocoa/background_gradient_view.h"
(...skipping 13 matching lines...) Expand all
43 #import "chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.h" 42 #import "chrome/browser/ui/cocoa/toolbar/wrench_toolbar_button_cell.h"
44 #import "chrome/browser/ui/cocoa/view_id_util.h" 43 #import "chrome/browser/ui/cocoa/view_id_util.h"
45 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h" 44 #import "chrome/browser/ui/cocoa/wrench_menu/wrench_menu_controller.h"
46 #include "chrome/browser/ui/global_error/global_error_service.h" 45 #include "chrome/browser/ui/global_error/global_error_service.h"
47 #include "chrome/browser/ui/global_error/global_error_service_factory.h" 46 #include "chrome/browser/ui/global_error/global_error_service_factory.h"
48 #include "chrome/browser/ui/omnibox/omnibox_view.h" 47 #include "chrome/browser/ui/omnibox/omnibox_view.h"
49 #include "chrome/browser/ui/tabs/tab_strip_model.h" 48 #include "chrome/browser/ui/tabs/tab_strip_model.h"
50 #include "chrome/browser/ui/toolbar/wrench_menu_model.h" 49 #include "chrome/browser/ui/toolbar/wrench_menu_model.h"
51 #include "chrome/browser/upgrade_detector.h" 50 #include "chrome/browser/upgrade_detector.h"
52 #include "chrome/common/pref_names.h" 51 #include "chrome/common/pref_names.h"
52 #include "components/metrics/proto/omnibox_event.pb.h"
53 #include "components/url_fixer/url_fixer.h" 53 #include "components/url_fixer/url_fixer.h"
54 #include "content/public/browser/notification_details.h" 54 #include "content/public/browser/notification_details.h"
55 #include "content/public/browser/notification_observer.h" 55 #include "content/public/browser/notification_observer.h"
56 #include "content/public/browser/notification_service.h" 56 #include "content/public/browser/notification_service.h"
57 #include "content/public/browser/web_contents.h" 57 #include "content/public/browser/web_contents.h"
58 #include "grit/chromium_strings.h" 58 #include "grit/chromium_strings.h"
59 #include "grit/generated_resources.h" 59 #include "grit/generated_resources.h"
60 #include "grit/theme_resources.h" 60 #include "grit/theme_resources.h"
61 #import "ui/base/cocoa/menu_controller.h" 61 #import "ui/base/cocoa/menu_controller.h"
62 #include "ui/base/l10n/l10n_util.h" 62 #include "ui/base/l10n/l10n_util.h"
(...skipping 766 matching lines...) Expand 10 before | Expand all | Expand 10 after
829 829
830 // (URLDropTargetController protocol) 830 // (URLDropTargetController protocol)
831 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point { 831 - (void)dropText:(NSString*)text inView:(NSView*)view at:(NSPoint)point {
832 // TODO(viettrungluu): This code is more or less copied from the code in 832 // TODO(viettrungluu): This code is more or less copied from the code in
833 // |TabStripController|. I'll refactor this soon to make it common and expand 833 // |TabStripController|. I'll refactor this soon to make it common and expand
834 // its capabilities (e.g., allow text DnD). 834 // its capabilities (e.g., allow text DnD).
835 835
836 // If the input is plain text, classify the input and make the URL. 836 // If the input is plain text, classify the input and make the URL.
837 AutocompleteMatch match; 837 AutocompleteMatch match;
838 AutocompleteClassifierFactory::GetForProfile(browser_->profile())->Classify( 838 AutocompleteClassifierFactory::GetForProfile(browser_->profile())->Classify(
839 base::SysNSStringToUTF16(text), false, false, AutocompleteInput::BLANK, 839 base::SysNSStringToUTF16(text), false, false,
840 &match, NULL); 840 metrics::OmniboxEventProto::BLANK, &match, NULL);
841 GURL url(match.destination_url); 841 GURL url(match.destination_url);
842 842
843 OpenURLParams params( 843 OpenURLParams params(
844 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false); 844 url, Referrer(), CURRENT_TAB, content::PAGE_TRANSITION_TYPED, false);
845 browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params); 845 browser_->tab_strip_model()->GetActiveWebContents()->OpenURL(params);
846 } 846 }
847 847
848 // (URLDropTargetController protocol) 848 // (URLDropTargetController protocol)
849 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 849 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
850 // Do nothing. 850 // Do nothing.
851 } 851 }
852 852
853 // (URLDropTargetController protocol) 853 // (URLDropTargetController protocol)
854 - (void)hideDropURLsIndicatorInView:(NSView*)view { 854 - (void)hideDropURLsIndicatorInView:(NSView*)view {
855 // Do nothing. 855 // Do nothing.
856 } 856 }
857 857
858 // (URLDropTargetController protocol) 858 // (URLDropTargetController protocol)
859 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info { 859 - (BOOL)isUnsupportedDropData:(id<NSDraggingInfo>)info {
860 return drag_util::IsUnsupportedDropData(profile_, info); 860 return drag_util::IsUnsupportedDropData(profile_, info);
861 } 861 }
862 862
863 @end 863 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698