| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/gtk/location_bar_view_gtk.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 | 8 |
| 9 #include "app/gtk_dnd_util.h" | 9 #include "app/gtk_dnd_util.h" |
| 10 #include "app/l10n_util.h" | 10 #include "app/l10n_util.h" |
| (...skipping 449 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 460 if (!instant) | 460 if (!instant) |
| 461 return false; | 461 return false; |
| 462 | 462 |
| 463 bool updating_instant = update_instant_; | 463 bool updating_instant = update_instant_; |
| 464 update_instant_ = false; | 464 update_instant_ = false; |
| 465 bool rv = location_entry_->CommitInstantSuggestion(); | 465 bool rv = location_entry_->CommitInstantSuggestion(); |
| 466 update_instant_ = updating_instant; | 466 update_instant_ = updating_instant; |
| 467 return rv; | 467 return rv; |
| 468 } | 468 } |
| 469 | 469 |
| 470 bool LocationBarViewGtk::AcceptCurrentInstantPreview() { | |
| 471 InstantController* instant = browser_->instant(); | |
| 472 if (instant && instant->IsCurrent()) { | |
| 473 instant->CommitCurrentPreview(INSTANT_COMMIT_PRESSED_ENTER); | |
| 474 return true; | |
| 475 } | |
| 476 return false; | |
| 477 } | |
| 478 | |
| 479 void LocationBarViewGtk::OnSetSuggestedSearchText( | 470 void LocationBarViewGtk::OnSetSuggestedSearchText( |
| 480 const string16& suggested_text) { | 471 const string16& suggested_text) { |
| 481 SetSuggestedText(suggested_text); | 472 SetSuggestedText(suggested_text); |
| 482 } | 473 } |
| 483 | 474 |
| 484 void LocationBarViewGtk::OnPopupBoundsChanged(const gfx::Rect& bounds) { | 475 void LocationBarViewGtk::OnPopupBoundsChanged(const gfx::Rect& bounds) { |
| 485 InstantController* instant = browser_->instant(); | 476 InstantController* instant = browser_->instant(); |
| 486 if (instant) | 477 if (instant) |
| 487 instant->SetOmniboxBounds(bounds); | 478 instant->SetOmniboxBounds(bounds); |
| 488 } | 479 } |
| (...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1534 | 1525 |
| 1535 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1526 std::string badge_text = page_action_->GetBadgeText(tab_id); |
| 1536 if (badge_text.empty()) | 1527 if (badge_text.empty()) |
| 1537 return FALSE; | 1528 return FALSE; |
| 1538 | 1529 |
| 1539 gfx::CanvasSkiaPaint canvas(event, false); | 1530 gfx::CanvasSkiaPaint canvas(event, false); |
| 1540 gfx::Rect bounding_rect(widget->allocation); | 1531 gfx::Rect bounding_rect(widget->allocation); |
| 1541 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1532 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
| 1542 return FALSE; | 1533 return FALSE; |
| 1543 } | 1534 } |
| OLD | NEW |