| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 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/browser/ui/views/location_bar/location_bar_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 49 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" | 49 #include "chrome/browser/ui/views/location_bar/page_action_with_badge_view.h" |
| 50 #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" | 50 #include "chrome/browser/ui/views/location_bar/selected_keyword_view.h" |
| 51 #include "chrome/browser/ui/views/location_bar/star_view.h" | 51 #include "chrome/browser/ui/views/location_bar/star_view.h" |
| 52 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" | 52 #include "chrome/browser/ui/views/location_bar/suggested_text_view.h" |
| 53 #include "chrome/browser/ui/views/location_bar/web_intents_button_view.h" | 53 #include "chrome/browser/ui/views/location_bar/web_intents_button_view.h" |
| 54 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" | 54 #include "chrome/browser/ui/views/location_bar/zoom_bubble_view.h" |
| 55 #include "chrome/browser/ui/views/location_bar/zoom_view.h" | 55 #include "chrome/browser/ui/views/location_bar/zoom_view.h" |
| 56 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 56 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
| 57 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" | 57 #include "chrome/browser/ui/views/omnibox/omnibox_views.h" |
| 58 #include "chrome/browser/ui/webui/instant_ui.h" | 58 #include "chrome/browser/ui/webui/instant_ui.h" |
| 59 #include "chrome/browser/ui/zoom/zoom_controller.h" |
| 59 #include "chrome/common/chrome_notification_types.h" | 60 #include "chrome/common/chrome_notification_types.h" |
| 60 #include "chrome/common/extensions/extension_switch_utils.h" | 61 #include "chrome/common/extensions/extension_switch_utils.h" |
| 61 #include "chrome/common/pref_names.h" | 62 #include "chrome/common/pref_names.h" |
| 62 #include "content/public/browser/notification_service.h" | 63 #include "content/public/browser/notification_service.h" |
| 63 #include "content/public/browser/render_widget_host_view.h" | 64 #include "content/public/browser/render_widget_host_view.h" |
| 64 #include "content/public/browser/web_contents.h" | 65 #include "content/public/browser/web_contents.h" |
| 65 #include "grit/generated_resources.h" | 66 #include "grit/generated_resources.h" |
| 66 #include "grit/theme_resources.h" | 67 #include "grit/theme_resources.h" |
| 67 #include "ui/base/accessibility/accessible_view_state.h" | 68 #include "ui/base/accessibility/accessible_view_state.h" |
| 68 #include "ui/base/dragdrop/drag_drop_types.h" | 69 #include "ui/base/dragdrop/drag_drop_types.h" |
| (...skipping 510 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 579 Layout(); | 580 Layout(); |
| 580 SchedulePaint(); | 581 SchedulePaint(); |
| 581 | 582 |
| 582 if (can_show_bubble && zoom_view_->visible()) | 583 if (can_show_bubble && zoom_view_->visible()) |
| 583 ZoomBubbleView::ShowBubble(zoom_view_, GetTabContents(), true); | 584 ZoomBubbleView::ShowBubble(zoom_view_, GetTabContents(), true); |
| 584 } | 585 } |
| 585 | 586 |
| 586 void LocationBarView::RefreshZoomView() { | 587 void LocationBarView::RefreshZoomView() { |
| 587 DCHECK(zoom_view_); | 588 DCHECK(zoom_view_); |
| 588 TabContents* tab_contents = GetTabContents(); | 589 TabContents* tab_contents = GetTabContents(); |
| 589 if (tab_contents) | 590 if (!tab_contents) |
| 590 zoom_view_->Update(tab_contents->zoom_controller()); | 591 return; |
| 592 |
| 593 ZoomController* zoom_controller = |
| 594 ZoomController::FromWebContents(tab_contents->web_contents()); |
| 595 zoom_view_->Update(zoom_controller); |
| 591 } | 596 } |
| 592 | 597 |
| 593 void LocationBarView::ShowChromeToMobileBubble() { | 598 void LocationBarView::ShowChromeToMobileBubble() { |
| 594 chrome::ShowChromeToMobileBubbleView(action_box_button_view_, | 599 chrome::ShowChromeToMobileBubbleView(action_box_button_view_, |
| 595 GetBrowserFromDelegate(delegate_)); | 600 GetBrowserFromDelegate(delegate_)); |
| 596 } | 601 } |
| 597 | 602 |
| 598 gfx::Point LocationBarView::GetLocationEntryOrigin() const { | 603 gfx::Point LocationBarView::GetLocationEntryOrigin() const { |
| 599 gfx::Point origin(location_entry_view_->bounds().origin()); | 604 gfx::Point origin(location_entry_view_->bounds().origin()); |
| 600 // If the UI layout is RTL, the coordinate system is not transformed and | 605 // If the UI layout is RTL, the coordinate system is not transformed and |
| (...skipping 1071 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1672 } | 1677 } |
| 1673 | 1678 |
| 1674 void LocationBarView::CleanupFadeAnimation() { | 1679 void LocationBarView::CleanupFadeAnimation() { |
| 1675 // Since we're no longer animating we don't need our layer. | 1680 // Since we're no longer animating we don't need our layer. |
| 1676 SetPaintToLayer(false); | 1681 SetPaintToLayer(false); |
| 1677 // Bubble labels don't need a transparent background anymore. | 1682 // Bubble labels don't need a transparent background anymore. |
| 1678 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1683 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1679 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1684 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1680 } | 1685 } |
| 1681 #endif // USE_AURA | 1686 #endif // USE_AURA |
| OLD | NEW |