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

Side by Side Diff: chrome/browser/ui/cocoa/tabs/tab_strip_controller.mm

Issue 343523003: Remove AutocompleteInput Type and PageClassification. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase 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/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>
11 #include <string> 11 #include <string>
12 12
13 #include "base/command_line.h" 13 #include "base/command_line.h"
14 #include "base/mac/mac_util.h" 14 #include "base/mac/mac_util.h"
15 #include "base/mac/scoped_nsautorelease_pool.h" 15 #include "base/mac/scoped_nsautorelease_pool.h"
16 #include "base/metrics/histogram.h" 16 #include "base/metrics/histogram.h"
17 #include "base/prefs/pref_service.h" 17 #include "base/prefs/pref_service.h"
18 #include "base/strings/sys_string_conversions.h" 18 #include "base/strings/sys_string_conversions.h"
19 #include "chrome/app/chrome_command_ids.h" 19 #include "chrome/app/chrome_command_ids.h"
20 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 20 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
21 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 21 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
22 #include "chrome/browser/autocomplete/autocomplete_input.h"
23 #include "chrome/browser/autocomplete/autocomplete_match.h" 22 #include "chrome/browser/autocomplete/autocomplete_match.h"
24 #include "chrome/browser/devtools/devtools_window.h" 23 #include "chrome/browser/devtools/devtools_window.h"
25 #include "chrome/browser/extensions/tab_helper.h" 24 #include "chrome/browser/extensions/tab_helper.h"
26 #include "chrome/browser/favicon/favicon_tab_helper.h" 25 #include "chrome/browser/favicon/favicon_tab_helper.h"
27 #include "chrome/browser/profiles/profile.h" 26 #include "chrome/browser/profiles/profile.h"
28 #include "chrome/browser/profiles/profile_manager.h" 27 #include "chrome/browser/profiles/profile_manager.h"
29 #include "chrome/browser/themes/theme_service.h" 28 #include "chrome/browser/themes/theme_service.h"
30 #include "chrome/browser/ui/browser.h" 29 #include "chrome/browser/ui/browser.h"
31 #include "chrome/browser/ui/browser_navigator.h" 30 #include "chrome/browser/ui/browser_navigator.h"
32 #include "chrome/browser/ui/browser_tabstrip.h" 31 #include "chrome/browser/ui/browser_tabstrip.h"
(...skipping 12 matching lines...) Expand all
45 #import "chrome/browser/ui/cocoa/tabs/tab_view.h" 44 #import "chrome/browser/ui/cocoa/tabs/tab_view.h"
46 #include "chrome/browser/ui/find_bar/find_bar.h" 45 #include "chrome/browser/ui/find_bar/find_bar.h"
47 #include "chrome/browser/ui/find_bar/find_bar_controller.h" 46 #include "chrome/browser/ui/find_bar/find_bar_controller.h"
48 #include "chrome/browser/ui/find_bar/find_tab_helper.h" 47 #include "chrome/browser/ui/find_bar/find_tab_helper.h"
49 #include "chrome/browser/ui/tabs/tab_menu_model.h" 48 #include "chrome/browser/ui/tabs/tab_menu_model.h"
50 #include "chrome/browser/ui/tabs/tab_strip_model.h" 49 #include "chrome/browser/ui/tabs/tab_strip_model.h"
51 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" 50 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
52 #include "chrome/browser/ui/tabs/tab_utils.h" 51 #include "chrome/browser/ui/tabs/tab_utils.h"
53 #include "chrome/common/chrome_switches.h" 52 #include "chrome/common/chrome_switches.h"
54 #include "chrome/common/pref_names.h" 53 #include "chrome/common/pref_names.h"
54 #include "components/metrics/proto/omnibox_event.pb.h"
55 #include "components/url_fixer/url_fixer.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 "
(...skipping 2019 matching lines...) Expand 10 before | Expand all | Expand 10 after
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.
2092 AutocompleteMatch match; 2092 AutocompleteMatch match;
2093 AutocompleteClassifierFactory::GetForProfile(browser_->profile())->Classify( 2093 AutocompleteClassifierFactory::GetForProfile(browser_->profile())->Classify(
2094 base::SysNSStringToUTF16(text), false, false, AutocompleteInput::BLANK, 2094 base::SysNSStringToUTF16(text), false, false,
2095 &match, NULL); 2095 metrics::OmniboxEventProto::BLANK, &match, NULL);
2096 GURL url(match.destination_url); 2096 GURL url(match.destination_url);
2097 2097
2098 [self openURL:&url inView:view at:point]; 2098 [self openURL:&url inView:view at:point];
2099 } 2099 }
2100 2100
2101 // (URLDropTargetController protocol) 2101 // (URLDropTargetController protocol)
2102 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point { 2102 - (void)indicateDropURLsInView:(NSView*)view at:(NSPoint)point {
2103 DCHECK_EQ(view, tabStripView_.get()); 2103 DCHECK_EQ(view, tabStripView_.get());
2104 2104
2105 // The minimum y-coordinate at which one should consider place the arrow. 2105 // The minimum y-coordinate at which one should consider place the arrow.
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
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 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/app_list/search/omnibox_provider.cc ('k') | chrome/browser/ui/cocoa/toolbar/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698