| 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 387 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 398 base::TimeDelta time) { | 398 base::TimeDelta time) { |
| 399 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 399 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 400 #if !defined(OS_ANDROID) | 400 #if !defined(OS_ANDROID) |
| 401 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) | 401 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) |
| 402 ->LogEvent(event, time); | 402 ->LogEvent(event, time); |
| 403 #endif | 403 #endif |
| 404 } | 404 } |
| 405 | 405 |
| 406 void SearchTabHelper::OnLogMostVisitedImpression( | 406 void SearchTabHelper::OnLogMostVisitedImpression( |
| 407 int position, | 407 int position, |
| 408 ntp_tiles::NTPTileSource tile_source) { | 408 ntp_tiles::TileSource tile_source) { |
| 409 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 409 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 410 #if !defined(OS_ANDROID) | 410 #if !defined(OS_ANDROID) |
| 411 NTPUserDataLogger::GetOrCreateFromWebContents( | 411 NTPUserDataLogger::GetOrCreateFromWebContents( |
| 412 web_contents())->LogMostVisitedImpression(position, tile_source); | 412 web_contents())->LogMostVisitedImpression(position, tile_source); |
| 413 #endif | 413 #endif |
| 414 } | 414 } |
| 415 | 415 |
| 416 void SearchTabHelper::OnLogMostVisitedNavigation( | 416 void SearchTabHelper::OnLogMostVisitedNavigation( |
| 417 int position, | 417 int position, |
| 418 ntp_tiles::NTPTileSource tile_source) { | 418 ntp_tiles::TileSource tile_source) { |
| 419 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 419 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 420 #if !defined(OS_ANDROID) | 420 #if !defined(OS_ANDROID) |
| 421 NTPUserDataLogger::GetOrCreateFromWebContents( | 421 NTPUserDataLogger::GetOrCreateFromWebContents( |
| 422 web_contents())->LogMostVisitedNavigation(position, tile_source); | 422 web_contents())->LogMostVisitedNavigation(position, tile_source); |
| 423 #endif | 423 #endif |
| 424 } | 424 } |
| 425 | 425 |
| 426 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { | 426 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { |
| 427 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 427 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
| 428 #if !defined(OS_ANDROID) | 428 #if !defined(OS_ANDROID) |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 533 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
| 534 } | 534 } |
| 535 | 535 |
| 536 bool SearchTabHelper::IsInputInProgress() const { | 536 bool SearchTabHelper::IsInputInProgress() const { |
| 537 if (model_.mode().is_ntp()) | 537 if (model_.mode().is_ntp()) |
| 538 return false; | 538 return false; |
| 539 const OmniboxView* omnibox_view = GetOmniboxView(); | 539 const OmniboxView* omnibox_view = GetOmniboxView(); |
| 540 return omnibox_view && | 540 return omnibox_view && |
| 541 omnibox_view->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 541 omnibox_view->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
| 542 } | 542 } |
| OLD | NEW |