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

Side by Side Diff: chrome/browser/ui/views/tabs/browser_tab_strip_controller.cc

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 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h" 5 #include "chrome/browser/ui/views/tabs/browser_tab_strip_controller.h"
6 6
7 #include "base/auto_reset.h" 7 #include "base/auto_reset.h"
8 #include "base/command_line.h" 8 #include "base/command_line.h"
9 #include "base/prefs/pref_service.h" 9 #include "base/prefs/pref_service.h"
10 #include "base/task_runner_util.h" 10 #include "base/task_runner_util.h"
11 #include "base/threading/sequenced_worker_pool.h" 11 #include "base/threading/sequenced_worker_pool.h"
12 #include "chrome/browser/autocomplete/autocomplete_classifier.h" 12 #include "chrome/browser/autocomplete/autocomplete_classifier.h"
13 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h" 13 #include "chrome/browser/autocomplete/autocomplete_classifier_factory.h"
14 #include "chrome/browser/autocomplete/autocomplete_input.h"
15 #include "chrome/browser/autocomplete/autocomplete_match.h" 14 #include "chrome/browser/autocomplete/autocomplete_match.h"
16 #include "chrome/browser/browser_process.h" 15 #include "chrome/browser/browser_process.h"
17 #include "chrome/browser/chrome_notification_types.h" 16 #include "chrome/browser/chrome_notification_types.h"
18 #include "chrome/browser/extensions/tab_helper.h" 17 #include "chrome/browser/extensions/tab_helper.h"
19 #include "chrome/browser/favicon/favicon_tab_helper.h" 18 #include "chrome/browser/favicon/favicon_tab_helper.h"
20 #include "chrome/browser/profiles/profile.h" 19 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/search/search.h" 20 #include "chrome/browser/search/search.h"
22 #include "chrome/browser/ui/browser.h" 21 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_tabstrip.h" 22 #include "chrome/browser/ui/browser_tabstrip.h"
24 #include "chrome/browser/ui/tabs/tab_menu_model.h" 23 #include "chrome/browser/ui/tabs/tab_menu_model.h"
25 #include "chrome/browser/ui/tabs/tab_strip_model.h" 24 #include "chrome/browser/ui/tabs/tab_strip_model.h"
26 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h" 25 #include "chrome/browser/ui/tabs/tab_strip_model_delegate.h"
27 #include "chrome/browser/ui/tabs/tab_utils.h" 26 #include "chrome/browser/ui/tabs/tab_utils.h"
28 #include "chrome/browser/ui/views/frame/browser_view.h" 27 #include "chrome/browser/ui/views/frame/browser_view.h"
29 #include "chrome/browser/ui/views/tabs/tab.h" 28 #include "chrome/browser/ui/views/tabs/tab.h"
30 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h" 29 #include "chrome/browser/ui/views/tabs/tab_renderer_data.h"
31 #include "chrome/browser/ui/views/tabs/tab_strip.h" 30 #include "chrome/browser/ui/views/tabs/tab_strip.h"
32 #include "chrome/common/pref_names.h" 31 #include "chrome/common/pref_names.h"
33 #include "chrome/common/url_constants.h" 32 #include "chrome/common/url_constants.h"
33 #include "components/metrics/proto/omnibox_event.pb.h"
34 #include "content/public/browser/browser_thread.h" 34 #include "content/public/browser/browser_thread.h"
35 #include "content/public/browser/notification_service.h" 35 #include "content/public/browser/notification_service.h"
36 #include "content/public/browser/plugin_service.h" 36 #include "content/public/browser/plugin_service.h"
37 #include "content/public/browser/user_metrics.h" 37 #include "content/public/browser/user_metrics.h"
38 #include "content/public/browser/web_contents.h" 38 #include "content/public/browser/web_contents.h"
39 #include "content/public/common/webplugininfo.h" 39 #include "content/public/common/webplugininfo.h"
40 #include "ipc/ipc_message.h" 40 #include "ipc/ipc_message.h"
41 #include "net/base/filename_util.h" 41 #include "net/base/filename_util.h"
42 #include "ui/base/models/list_selection_model.h" 42 #include "ui/base/models/list_selection_model.h"
43 #include "ui/gfx/image/image.h" 43 #include "ui/gfx/image/image.h"
(...skipping 320 matching lines...) Expand 10 before | Expand all | Expand 10 after
364 void BrowserTabStripController::CreateNewTab() { 364 void BrowserTabStripController::CreateNewTab() {
365 model_->delegate()->AddTabAt(GURL(), -1, true); 365 model_->delegate()->AddTabAt(GURL(), -1, true);
366 } 366 }
367 367
368 void BrowserTabStripController::CreateNewTabWithLocation( 368 void BrowserTabStripController::CreateNewTabWithLocation(
369 const base::string16& location) { 369 const base::string16& location) {
370 // Use autocomplete to clean up the text, going so far as to turn it into 370 // Use autocomplete to clean up the text, going so far as to turn it into
371 // a search query if necessary. 371 // a search query if necessary.
372 AutocompleteMatch match; 372 AutocompleteMatch match;
373 AutocompleteClassifierFactory::GetForProfile(profile())->Classify( 373 AutocompleteClassifierFactory::GetForProfile(profile())->Classify(
374 location, false, false, AutocompleteInput::BLANK, &match, NULL); 374 location, false, false, metrics::OmniboxEventProto::BLANK, &match, NULL);
375 if (match.destination_url.is_valid()) 375 if (match.destination_url.is_valid())
376 model_->delegate()->AddTabAt(match.destination_url, -1, true); 376 model_->delegate()->AddTabAt(match.destination_url, -1, true);
377 } 377 }
378 378
379 bool BrowserTabStripController::IsIncognito() { 379 bool BrowserTabStripController::IsIncognito() {
380 return browser_->profile()->IsOffTheRecord(); 380 return browser_->profile()->IsOffTheRecord();
381 } 381 }
382 382
383 void BrowserTabStripController::StackedLayoutMaybeChanged() { 383 void BrowserTabStripController::StackedLayoutMaybeChanged() {
384 bool adjust_layout = false; 384 bool adjust_layout = false;
(...skipping 195 matching lines...) Expand 10 before | Expand all | Expand 10 after
580 url, 580 url,
581 mime_type.empty() || 581 mime_type.empty() ||
582 net::IsSupportedMimeType(mime_type) || 582 net::IsSupportedMimeType(mime_type) ||
583 content::PluginService::GetInstance()->GetPluginInfo( 583 content::PluginService::GetInstance()->GetPluginInfo(
584 -1, // process ID 584 -1, // process ID
585 MSG_ROUTING_NONE, // routing ID 585 MSG_ROUTING_NONE, // routing ID
586 model_->profile()->GetResourceContext(), 586 model_->profile()->GetResourceContext(),
587 url, GURL(), mime_type, false, 587 url, GURL(), mime_type, false,
588 NULL, &plugin, NULL)); 588 NULL, &plugin, NULL));
589 } 589 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698