OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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/search/search_tab_helper.h" | 5 #include "chrome/browser/ui/search/search_tab_helper.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include <set> | 8 #include <set> |
9 | 9 |
10 #include "base/macros.h" | 10 #include "base/macros.h" |
(...skipping 459 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
470 void SearchTabHelper::OnLogEvent(NTPLoggingEventType event, | 470 void SearchTabHelper::OnLogEvent(NTPLoggingEventType event, |
471 base::TimeDelta time) { | 471 base::TimeDelta time) { |
472 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 472 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
473 #if !defined(OS_ANDROID) | 473 #if !defined(OS_ANDROID) |
474 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) | 474 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) |
475 ->LogEvent(event, time); | 475 ->LogEvent(event, time); |
476 #endif | 476 #endif |
477 } | 477 } |
478 | 478 |
479 void SearchTabHelper::OnLogMostVisitedImpression( | 479 void SearchTabHelper::OnLogMostVisitedImpression( |
480 int position, const base::string16& provider) { | 480 int position, NTPLoggingTileSource tile_source) { |
481 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 481 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
482 #if !defined(OS_ANDROID) | 482 #if !defined(OS_ANDROID) |
483 NTPUserDataLogger::GetOrCreateFromWebContents( | 483 NTPUserDataLogger::GetOrCreateFromWebContents( |
484 web_contents())->LogMostVisitedImpression(position, provider); | 484 web_contents())->LogMostVisitedImpression(position, tile_source); |
485 #endif | 485 #endif |
486 } | 486 } |
487 | 487 |
488 void SearchTabHelper::OnLogMostVisitedNavigation( | 488 void SearchTabHelper::OnLogMostVisitedNavigation( |
489 int position, const base::string16& provider) { | 489 int position, NTPLoggingTileSource tile_source) { |
490 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 490 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
491 #if !defined(OS_ANDROID) | 491 #if !defined(OS_ANDROID) |
492 NTPUserDataLogger::GetOrCreateFromWebContents( | 492 NTPUserDataLogger::GetOrCreateFromWebContents( |
493 web_contents())->LogMostVisitedNavigation(position, provider); | 493 web_contents())->LogMostVisitedNavigation(position, tile_source); |
494 #endif | 494 #endif |
495 } | 495 } |
496 | 496 |
497 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { | 497 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { |
498 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 498 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
499 #if !defined(OS_ANDROID) | 499 #if !defined(OS_ANDROID) |
500 OmniboxView* omnibox = GetOmniboxView(); | 500 OmniboxView* omnibox = GetOmniboxView(); |
501 if (!omnibox) | 501 if (!omnibox) |
502 return; | 502 return; |
503 // The first case is for right click to paste, where the text is retrieved | 503 // The first case is for right click to paste, where the text is retrieved |
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
581 | 581 |
582 bool SearchTabHelper::IsInputInProgress() const { | 582 bool SearchTabHelper::IsInputInProgress() const { |
583 OmniboxView* omnibox = GetOmniboxView(); | 583 OmniboxView* omnibox = GetOmniboxView(); |
584 return !model_.mode().is_ntp() && omnibox && | 584 return !model_.mode().is_ntp() && omnibox && |
585 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 585 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
586 } | 586 } |
587 | 587 |
588 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 588 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
589 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 589 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
590 } | 590 } |
OLD | NEW |