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::TileSource tile_source) { | 408 ntp_tiles::TileSource tile_source, |
| 409 ntp_tiles::TileVisualType tile_type) { |
409 // 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. |
410 #if !defined(OS_ANDROID) | 411 #if !defined(OS_ANDROID) |
411 NTPUserDataLogger::GetOrCreateFromWebContents( | 412 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) |
412 web_contents())->LogMostVisitedImpression(position, tile_source); | 413 ->LogMostVisitedImpression(position, tile_source, tile_type); |
413 #endif | 414 #endif |
414 } | 415 } |
415 | 416 |
416 void SearchTabHelper::OnLogMostVisitedNavigation( | 417 void SearchTabHelper::OnLogMostVisitedNavigation( |
417 int position, | 418 int position, |
418 ntp_tiles::TileSource tile_source) { | 419 ntp_tiles::TileSource tile_source, |
| 420 ntp_tiles::TileVisualType tile_type) { |
419 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 421 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
420 #if !defined(OS_ANDROID) | 422 #if !defined(OS_ANDROID) |
421 NTPUserDataLogger::GetOrCreateFromWebContents( | 423 NTPUserDataLogger::GetOrCreateFromWebContents(web_contents()) |
422 web_contents())->LogMostVisitedNavigation(position, tile_source); | 424 ->LogMostVisitedNavigation(position, tile_source, tile_type); |
423 #endif | 425 #endif |
424 } | 426 } |
425 | 427 |
426 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { | 428 void SearchTabHelper::PasteIntoOmnibox(const base::string16& text) { |
427 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. | 429 // TODO(kmadhusu): Move platform specific code from here and get rid of #ifdef. |
428 #if !defined(OS_ANDROID) | 430 #if !defined(OS_ANDROID) |
429 OmniboxView* omnibox_view = GetOmniboxView(); | 431 OmniboxView* omnibox_view = GetOmniboxView(); |
430 if (!omnibox_view) | 432 if (!omnibox_view) |
431 return; | 433 return; |
432 // The first case is for right click to paste, where the text is retrieved | 434 // The first case is for right click to paste, where the text is retrieved |
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
533 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); | 535 return Profile::FromBrowserContext(web_contents_->GetBrowserContext()); |
534 } | 536 } |
535 | 537 |
536 bool SearchTabHelper::IsInputInProgress() const { | 538 bool SearchTabHelper::IsInputInProgress() const { |
537 if (model_.mode().is_ntp()) | 539 if (model_.mode().is_ntp()) |
538 return false; | 540 return false; |
539 const OmniboxView* omnibox_view = GetOmniboxView(); | 541 const OmniboxView* omnibox_view = GetOmniboxView(); |
540 return omnibox_view && | 542 return omnibox_view && |
541 omnibox_view->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; | 543 omnibox_view->model()->focus_state() == OMNIBOX_FOCUS_VISIBLE; |
542 } | 544 } |
OLD | NEW |