| 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/renderer/searchbox/searchbox.h" | 5 #include "chrome/renderer/searchbox/searchbox.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "base/strings/string_number_conversions.h" | 9 #include "base/strings/string_number_conversions.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 446 } | 446 } |
| 447 } | 447 } |
| 448 } | 448 } |
| 449 } | 449 } |
| 450 | 450 |
| 451 void SearchBox::OnSetDisplayInstantResults(bool display_instant_results) { | 451 void SearchBox::OnSetDisplayInstantResults(bool display_instant_results) { |
| 452 display_instant_results_ = display_instant_results; | 452 display_instant_results_ = display_instant_results; |
| 453 } | 453 } |
| 454 | 454 |
| 455 void SearchBox::OnThemeChanged(const ThemeBackgroundInfo& theme_info) { | 455 void SearchBox::OnThemeChanged(const ThemeBackgroundInfo& theme_info) { |
| 456 // Do not send duplicate notifications. |
| 457 if (theme_info_ == theme_info) |
| 458 return; |
| 459 |
| 456 theme_info_ = theme_info; | 460 theme_info_ = theme_info; |
| 457 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { | 461 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { |
| 458 extensions_v8::SearchBoxExtension::DispatchThemeChange( | 462 extensions_v8::SearchBoxExtension::DispatchThemeChange( |
| 459 render_view()->GetWebView()->mainFrame()); | 463 render_view()->GetWebView()->mainFrame()); |
| 460 } | 464 } |
| 461 } | 465 } |
| 462 | 466 |
| 463 void SearchBox::OnFontInformationReceived(const string16& omnibox_font, | 467 void SearchBox::OnFontInformationReceived(const string16& omnibox_font, |
| 464 size_t omnibox_font_size) { | 468 size_t omnibox_font_size) { |
| 465 omnibox_font_ = omnibox_font; | 469 omnibox_font_ = omnibox_font; |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 525 InstantMostVisitedItem item; | 529 InstantMostVisitedItem item; |
| 526 return GetMostVisitedItemWithID(item_id, &item) ? item.url : GURL(); | 530 return GetMostVisitedItemWithID(item_id, &item) ? item.url : GURL(); |
| 527 } | 531 } |
| 528 | 532 |
| 529 void SearchBox::OnToggleVoiceSearch() { | 533 void SearchBox::OnToggleVoiceSearch() { |
| 530 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { | 534 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { |
| 531 extensions_v8::SearchBoxExtension::DispatchToggleVoiceSearch( | 535 extensions_v8::SearchBoxExtension::DispatchToggleVoiceSearch( |
| 532 render_view()->GetWebView()->mainFrame()); | 536 render_view()->GetWebView()->mainFrame()); |
| 533 } | 537 } |
| 534 } | 538 } |
| OLD | NEW |