| 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 |
| 11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
| 12 #include "base/command_line.h" | 12 #include "base/command_line.h" |
| 13 #include "base/i18n/rtl.h" | 13 #include "base/i18n/rtl.h" |
| 14 #include "base/logging.h" | 14 #include "base/logging.h" |
| 15 #include "base/string_util.h" | 15 #include "base/string_util.h" |
| 16 #include "base/utf_string_conversions.h" | 16 #include "base/utf_string_conversions.h" |
| 17 #include "chrome/app/chrome_command_ids.h" | 17 #include "chrome/app/chrome_command_ids.h" |
| 18 #include "chrome/browser/accessibility_events.h" | 18 #include "chrome/browser/accessibility_events.h" |
| 19 #include "chrome/browser/alternate_nav_url_fetcher.h" | 19 #include "chrome/browser/alternate_nav_url_fetcher.h" |
| 20 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" | 20 #include "chrome/browser/autocomplete/autocomplete_edit_view_gtk.h" |
| 21 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" | 21 #include "chrome/browser/autocomplete/autocomplete_popup_model.h" |
| 22 #include "chrome/browser/command_updater.h" | 22 #include "chrome/browser/command_updater.h" |
| 23 #include "chrome/browser/content_setting_bubble_model.h" | 23 #include "chrome/browser/content_setting_bubble_model.h" |
| 24 #include "chrome/browser/content_setting_image_model.h" | 24 #include "chrome/browser/content_setting_image_model.h" |
| 25 #include "chrome/browser/defaults.h" | 25 #include "chrome/browser/defaults.h" |
| 26 #include "chrome/browser/extensions/extension_browser_event_router.h" | 26 #include "chrome/browser/extensions/extension_browser_event_router.h" |
| 27 #include "chrome/browser/extensions/extension_service.h" | 27 #include "chrome/browser/extensions/extension_service.h" |
| 28 #include "chrome/browser/extensions/extension_tabs_module.h" | 28 #include "chrome/browser/extensions/extension_tabs_module.h" |
| 29 #include "chrome/browser/favicon_tab_helper.h" | |
| 30 #include "chrome/browser/instant/instant_controller.h" | 29 #include "chrome/browser/instant/instant_controller.h" |
| 31 #include "chrome/browser/profiles/profile.h" | 30 #include "chrome/browser/profiles/profile.h" |
| 32 #include "chrome/browser/search_engines/template_url.h" | 31 #include "chrome/browser/search_engines/template_url.h" |
| 33 #include "chrome/browser/search_engines/template_url_model.h" | 32 #include "chrome/browser/search_engines/template_url_model.h" |
| 34 #include "chrome/browser/ui/browser.h" | 33 #include "chrome/browser/ui/browser.h" |
| 35 #include "chrome/browser/ui/browser_list.h" | 34 #include "chrome/browser/ui/browser_list.h" |
| 36 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h" | 35 #include "chrome/browser/ui/gtk/bookmarks/bookmark_bubble_gtk.h" |
| 37 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" | 36 #include "chrome/browser/ui/gtk/bookmarks/bookmark_utils_gtk.h" |
| 38 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" | 37 #include "chrome/browser/ui/gtk/cairo_cached_surface.h" |
| 39 #include "chrome/browser/ui/gtk/content_setting_bubble_gtk.h" | 38 #include "chrome/browser/ui/gtk/content_setting_bubble_gtk.h" |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 556 NotificationService::current()->Notify( | 555 NotificationService::current()->Notify( |
| 557 NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, | 556 NotificationType::ACCESSIBILITY_CONTROL_FOCUSED, |
| 558 Source<Profile>(profile_), | 557 Source<Profile>(profile_), |
| 559 Details<AccessibilityTextBoxInfo>(&info)); | 558 Details<AccessibilityTextBoxInfo>(&info)); |
| 560 | 559 |
| 561 // Update the keyword and search hint states. | 560 // Update the keyword and search hint states. |
| 562 OnChanged(); | 561 OnChanged(); |
| 563 } | 562 } |
| 564 | 563 |
| 565 SkBitmap LocationBarViewGtk::GetFavicon() const { | 564 SkBitmap LocationBarViewGtk::GetFavicon() const { |
| 566 return GetTabContentsWrapper()->favicon_tab_helper()->GetFavicon(); | 565 return GetTabContents()->GetFavicon(); |
| 567 } | 566 } |
| 568 | 567 |
| 569 string16 LocationBarViewGtk::GetTitle() const { | 568 string16 LocationBarViewGtk::GetTitle() const { |
| 570 return GetTabContents()->GetTitle(); | 569 return GetTabContents()->GetTitle(); |
| 571 } | 570 } |
| 572 | 571 |
| 573 InstantController* LocationBarViewGtk::GetInstant() { | 572 InstantController* LocationBarViewGtk::GetInstant() { |
| 574 return browser_->instant(); | 573 return browser_->instant(); |
| 575 } | 574 } |
| 576 | 575 |
| 577 TabContentsWrapper* LocationBarViewGtk::GetTabContentsWrapper() const { | 576 TabContentsWrapper* LocationBarViewGtk::GetTabContentsWrapper() { |
| 578 return browser_->GetSelectedTabContentsWrapper(); | 577 return browser_->GetSelectedTabContentsWrapper(); |
| 579 } | 578 } |
| 580 | 579 |
| 581 void LocationBarViewGtk::ShowFirstRunBubble(FirstRun::BubbleType bubble_type) { | 580 void LocationBarViewGtk::ShowFirstRunBubble(FirstRun::BubbleType bubble_type) { |
| 582 // We need the browser window to be shown before we can show the bubble, but | 581 // We need the browser window to be shown before we can show the bubble, but |
| 583 // we get called before that's happened. | 582 // we get called before that's happened. |
| 584 Task* task = first_run_bubble_.NewRunnableMethod( | 583 Task* task = first_run_bubble_.NewRunnableMethod( |
| 585 &LocationBarViewGtk::ShowFirstRunBubbleInternal, bubble_type); | 584 &LocationBarViewGtk::ShowFirstRunBubbleInternal, bubble_type); |
| 586 MessageLoop::current()->PostTask(FROM_HERE, task); | 585 MessageLoop::current()->PostTask(FROM_HERE, task); |
| 587 } | 586 } |
| (...skipping 1039 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1627 | 1626 |
| 1628 std::string badge_text = page_action_->GetBadgeText(tab_id); | 1627 std::string badge_text = page_action_->GetBadgeText(tab_id); |
| 1629 if (badge_text.empty()) | 1628 if (badge_text.empty()) |
| 1630 return FALSE; | 1629 return FALSE; |
| 1631 | 1630 |
| 1632 gfx::CanvasSkiaPaint canvas(event, false); | 1631 gfx::CanvasSkiaPaint canvas(event, false); |
| 1633 gfx::Rect bounding_rect(widget->allocation); | 1632 gfx::Rect bounding_rect(widget->allocation); |
| 1634 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); | 1633 page_action_->PaintBadge(&canvas, bounding_rect, tab_id); |
| 1635 return FALSE; | 1634 return FALSE; |
| 1636 } | 1635 } |
| OLD | NEW |