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 |
470 void LocationBarViewGtk::OnSetSuggestedSearchText( | 479 void LocationBarViewGtk::OnSetSuggestedSearchText( |
471 const string16& suggested_text) { | 480 const string16& suggested_text) { |
472 SetSuggestedText(suggested_text); | 481 SetSuggestedText(suggested_text); |
473 } | 482 } |
474 | 483 |
475 void LocationBarViewGtk::OnPopupBoundsChanged(const gfx::Rect& bounds) { | 484 void LocationBarViewGtk::OnPopupBoundsChanged(const gfx::Rect& bounds) { |
476 InstantController* instant = browser_->instant(); | 485 InstantController* instant = browser_->instant(); |
477 if (instant) | 486 if (instant) |
478 instant->SetOmniboxBounds(bounds); | 487 instant->SetOmniboxBounds(bounds); |
479 } | 488 } |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1525 | 1534 |
1526 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1535 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1527 if (badge_text.empty()) | 1536 if (badge_text.empty()) |
1528 return FALSE; | 1537 return FALSE; |
1529 | 1538 |
1530 gfx::CanvasSkiaPaint canvas(event, false); | 1539 gfx::CanvasSkiaPaint canvas(event, false); |
1531 gfx::Rect bounding_rect(widget->allocation); | 1540 gfx::Rect bounding_rect(widget->allocation); |
1532 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1541 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
1533 return FALSE; | 1542 return FALSE; |
1534 } | 1543 } |
OLD | NEW |