| 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/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 369 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 void SearchTabHelper::OnLogEvent(NTPLoggingEventType event, | 380 void SearchTabHelper::OnLogEvent(NTPLoggingEventType event, |
| 381 base::TimeDelta time) { | 381 base::TimeDelta time) { |
| 382 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 382 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 383 #if !defined(OS_ANDROID) | 383 #if !defined(OS_ANDROID) |
| 384 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) | 384 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) |
| 385 ->LogEvent(event, time); | 385 ->LogEvent(event, time); |
| 386 #endif | 386 #endif |
| 387 } | 387 } |
| 388 | 388 |
| 389 void SearchTabHelper::OnLogMostVisitedImpression( | 389 void SearchTabHelper::OnLogMostVisitedImpression( |
| 390 int position, NTPLoggingTileSource tile_source) { | 390 int position, |
| 391 ntp_tiles::NTPTileSource tile_source) { |
| 391 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 392 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 392 #if !defined(OS_ANDROID) | 393 #if !defined(OS_ANDROID) |
| 393 NTPUserDataLogger::GetOrCreateFromWebContents( | 394 NTPUserDataLogger::GetOrCreateFromWebContents( |
| 394 web_contents())->LogMostVisitedImpression(position, tile_source); | 395 web_contents())->LogMostVisitedImpression(position, tile_source); |
| 395 #endif | 396 #endif |
| 396 } | 397 } |
| 397 | 398 |
| 398 void SearchTabHelper::OnLogMostVisitedNavigation( | 399 void SearchTabHelper::OnLogMostVisitedNavigation( |
| 399 int position, NTPLoggingTileSource tile_source) { | 400 int position, |
| 401 ntp_tiles::NTPTileSource tile_source) { |
| 400 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 402 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 401 #if !defined(OS_ANDROID) | 403 #if !defined(OS_ANDROID) |
| 402 NTPUserDataLogger::GetOrCreateFromWebContents( | 404 NTPUserDataLogger::GetOrCreateFromWebContents( |
| 403 web_contents())->LogMostVisitedNavigation(position, tile_source); | 405 web_contents())->LogMostVisitedNavigation(position, tile_source); |
| 404 #endif | 406 #endif |
| 405 } | 407 } |
| 406 | 408 |
| 407 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { | 409 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { |
| 408 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 410 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 409 #if !defined(OS_ANDROID) | 411 #if !defined(OS_ANDROID) |
| (...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 503 | 505 |
| 504 bool SearchTabHelper::IsInputInProgress() const { | 506 bool SearchTabHelper::IsInputInProgress() const { |
| 505 OmniboxView* omnibox = GetOmniboxView(); | 507 OmniboxView* omnibox = GetOmniboxView(); |
| 506 return !model_.mode().is_ntp() && omnibox && | 508 return !model_.mode().is_ntp() && omnibox && |
| 507 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 509 omnibox->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
| 508 } | 510 } |
| 509 | 511 |
| 510 OmniboxView* SearchTabHelper::GetOmniboxView() const { | 512 OmniboxView* SearchTabHelper::GetOmniboxView() const { |
| 511 return delegate_ ? delegate_->GetOmniboxView() : NULL; | 513 return delegate_ ? delegate_->GetOmniboxView() : NULL; |
| 512 } | 514 } |
| OLD | NEW |