OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/gtk/location_bar_view_gtk.h" | 5 #include "chrome/browser/ui/gtk/location_bar_view_gtk.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 454 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
465 } else { | 465 } else { |
466 gtk_widget_queue_draw(widget()); | 466 gtk_widget_queue_draw(widget()); |
467 } | 467 } |
468 } | 468 } |
469 | 469 |
470 void LocationBarViewGtk::OnAutocompleteAccept(const GURL& url, | 470 void LocationBarViewGtk::OnAutocompleteAccept(const GURL& url, |
471 WindowOpenDisposition disposition, | 471 WindowOpenDisposition disposition, |
472 PageTransition::Type transition, | 472 PageTransition::Type transition, |
473 const GURL& alternate_nav_url) { | 473 const GURL& alternate_nav_url) { |
474 if (url.is_valid()) { | 474 if (url.is_valid()) { |
475 location_input_ = UTF8ToWide(url.spec()); | 475 location_input_ = UTF8ToUTF16(url.spec()); |
476 disposition_ = disposition; | 476 disposition_ = disposition; |
477 transition_ = transition; | 477 transition_ = transition; |
478 | 478 |
479 if (command_updater_) { | 479 if (command_updater_) { |
480 if (!alternate_nav_url.is_valid()) { | 480 if (!alternate_nav_url.is_valid()) { |
481 command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); | 481 command_updater_->ExecuteCommand(IDC_OPEN_CURRENT_URL); |
482 } else { | 482 } else { |
483 AlternateNavURLFetcher* fetcher = | 483 AlternateNavURLFetcher* fetcher = |
484 new AlternateNavURLFetcher(alternate_nav_url); | 484 new AlternateNavURLFetcher(alternate_nav_url); |
485 // The AlternateNavURLFetcher will listen for the pending navigation | 485 // The AlternateNavURLFetcher will listen for the pending navigation |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
589 Task* task = first_run_bubble_.NewRunnableMethod( | 589 Task* task = first_run_bubble_.NewRunnableMethod( |
590 &LocationBarViewGtk::ShowFirstRunBubbleInternal, bubble_type); | 590 &LocationBarViewGtk::ShowFirstRunBubbleInternal, bubble_type); |
591 MessageLoop::current()->PostTask(FROM_HERE, task); | 591 MessageLoop::current()->PostTask(FROM_HERE, task); |
592 } | 592 } |
593 | 593 |
594 void LocationBarViewGtk::SetSuggestedText(const string16& text, | 594 void LocationBarViewGtk::SetSuggestedText(const string16& text, |
595 InstantCompleteBehavior behavior) { | 595 InstantCompleteBehavior behavior) { |
596 location_entry_->model()->SetSuggestedText(text, behavior); | 596 location_entry_->model()->SetSuggestedText(text, behavior); |
597 } | 597 } |
598 | 598 |
599 std::wstring LocationBarViewGtk::GetInputString() const { | 599 string16 LocationBarViewGtk::GetInputString() const { |
600 return location_input_; | 600 return location_input_; |
601 } | 601 } |
602 | 602 |
603 WindowOpenDisposition LocationBarViewGtk::GetWindowOpenDisposition() const { | 603 WindowOpenDisposition LocationBarViewGtk::GetWindowOpenDisposition() const { |
604 return disposition_; | 604 return disposition_; |
605 } | 605 } |
606 | 606 |
607 PageTransition::Type LocationBarViewGtk::GetPageTransition() const { | 607 PageTransition::Type LocationBarViewGtk::GetPageTransition() const { |
608 return transition_; | 608 return transition_; |
609 } | 609 } |
(...skipping 1025 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1635 | 1635 |
1636 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1636 std::string badge_text = page_action_->GetBadgeText(tab_id); |
1637 if (badge_text.empty()) | 1637 if (badge_text.empty()) |
1638 return FALSE; | 1638 return FALSE; |
1639 | 1639 |
1640 gfx::CanvasSkiaPaint canvas(event, false); | 1640 gfx::CanvasSkiaPaint canvas(event, false); |
1641 gfx::Rect bounding_rect(widget->allocation); | 1641 gfx::Rect bounding_rect(widget->allocation); |
1642 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1642 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
1643 return FALSE; | 1643 return FALSE; |
1644 } | 1644 } |
OLD | NEW |