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 430 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
441 } | 441 } |
442 } | 442 } |
443 } | 443 } |
444 } | 444 } |
445 | 445 |
446 void SearchBox::OnSetDisplayInstantResults(bool display_instant_results) { | 446 void SearchBox::OnSetDisplayInstantResults(bool display_instant_results) { |
447 display_instant_results_ = display_instant_results; | 447 display_instant_results_ = display_instant_results; |
448 } | 448 } |
449 | 449 |
450 void SearchBox::OnThemeChanged(const ThemeBackgroundInfo& theme_info) { | 450 void SearchBox::OnThemeChanged(const ThemeBackgroundInfo& theme_info) { |
| 451 // Do not send duplicate notifications. |
| 452 if (theme_info_ == theme_info) |
| 453 return; |
| 454 |
451 theme_info_ = theme_info; | 455 theme_info_ = theme_info; |
452 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { | 456 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { |
453 extensions_v8::SearchBoxExtension::DispatchThemeChange( | 457 extensions_v8::SearchBoxExtension::DispatchThemeChange( |
454 render_view()->GetWebView()->mainFrame()); | 458 render_view()->GetWebView()->mainFrame()); |
455 } | 459 } |
456 } | 460 } |
457 | 461 |
458 void SearchBox::OnFontInformationReceived(const string16& omnibox_font, | 462 void SearchBox::OnFontInformationReceived(const string16& omnibox_font, |
459 size_t omnibox_font_size) { | 463 size_t omnibox_font_size) { |
460 omnibox_font_ = omnibox_font; | 464 omnibox_font_ = omnibox_font; |
(...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
520 InstantMostVisitedItem item; | 524 InstantMostVisitedItem item; |
521 return GetMostVisitedItemWithID(item_id, &item) ? item.url : GURL(); | 525 return GetMostVisitedItemWithID(item_id, &item) ? item.url : GURL(); |
522 } | 526 } |
523 | 527 |
524 void SearchBox::OnToggleVoiceSearch() { | 528 void SearchBox::OnToggleVoiceSearch() { |
525 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { | 529 if (render_view()->GetWebView() && render_view()->GetWebView()->mainFrame()) { |
526 extensions_v8::SearchBoxExtension::DispatchToggleVoiceSearch( | 530 extensions_v8::SearchBoxExtension::DispatchToggleVoiceSearch( |
527 render_view()->GetWebView()->mainFrame()); | 531 render_view()->GetWebView()->mainFrame()); |
528 } | 532 } |
529 } | 533 } |
OLD | NEW |