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/stl_util.h" | 10 #include "base/stl_util.h" |
(...skipping 915 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
926 void LocationBarView::SetShowFocusRect(bool show) { | 926 void LocationBarView::SetShowFocusRect(bool show) { |
927 show_focus_rect_ = show; | 927 show_focus_rect_ = show; |
928 SchedulePaint(); | 928 SchedulePaint(); |
929 } | 929 } |
930 | 930 |
931 void LocationBarView::SelectAll() { | 931 void LocationBarView::SelectAll() { |
932 location_entry_->SelectAll(true); | 932 location_entry_->SelectAll(true); |
933 } | 933 } |
934 | 934 |
935 #if defined(OS_WIN) && !defined(USE_AURA) | 935 #if defined(OS_WIN) && !defined(USE_AURA) |
936 bool LocationBarView::OnMousePressed(const views::MouseEvent& event) { | 936 bool LocationBarView::OnMousePressed(const ui::MouseEvent& event) { |
937 UINT msg; | 937 UINT msg; |
938 if (event.IsLeftMouseButton()) { | 938 if (event.IsLeftMouseButton()) { |
939 msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? | 939 msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? |
940 WM_LBUTTONDBLCLK : WM_LBUTTONDOWN; | 940 WM_LBUTTONDBLCLK : WM_LBUTTONDOWN; |
941 } else if (event.IsMiddleMouseButton()) { | 941 } else if (event.IsMiddleMouseButton()) { |
942 msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? | 942 msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? |
943 WM_MBUTTONDBLCLK : WM_MBUTTONDOWN; | 943 WM_MBUTTONDBLCLK : WM_MBUTTONDOWN; |
944 } else if (event.IsRightMouseButton()) { | 944 } else if (event.IsRightMouseButton()) { |
945 msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? | 945 msg = (event.flags() & ui::EF_IS_DOUBLE_CLICK) ? |
946 WM_RBUTTONDBLCLK : WM_RBUTTONDOWN; | 946 WM_RBUTTONDBLCLK : WM_RBUTTONDOWN; |
947 } else { | 947 } else { |
948 NOTREACHED(); | 948 NOTREACHED(); |
949 return false; | 949 return false; |
950 } | 950 } |
951 OnMouseEvent(event, msg); | 951 OnMouseEvent(event, msg); |
952 return true; | 952 return true; |
953 } | 953 } |
954 | 954 |
955 bool LocationBarView::OnMouseDragged(const views::MouseEvent& event) { | 955 bool LocationBarView::OnMouseDragged(const ui::MouseEvent& event) { |
956 OnMouseEvent(event, WM_MOUSEMOVE); | 956 OnMouseEvent(event, WM_MOUSEMOVE); |
957 return true; | 957 return true; |
958 } | 958 } |
959 | 959 |
960 void LocationBarView::OnMouseReleased(const views::MouseEvent& event) { | 960 void LocationBarView::OnMouseReleased(const ui::MouseEvent& event) { |
961 UINT msg; | 961 UINT msg; |
962 if (event.IsLeftMouseButton()) { | 962 if (event.IsLeftMouseButton()) { |
963 msg = WM_LBUTTONUP; | 963 msg = WM_LBUTTONUP; |
964 } else if (event.IsMiddleMouseButton()) { | 964 } else if (event.IsMiddleMouseButton()) { |
965 msg = WM_MBUTTONUP; | 965 msg = WM_MBUTTONUP; |
966 } else if (event.IsRightMouseButton()) { | 966 } else if (event.IsRightMouseButton()) { |
967 msg = WM_RBUTTONUP; | 967 msg = WM_RBUTTONUP; |
968 } else { | 968 } else { |
969 NOTREACHED(); | 969 NOTREACHED(); |
970 return; | 970 return; |
(...skipping 192 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1163 content::NotificationService::current()->Notify( | 1163 content::NotificationService::current()->Notify( |
1164 chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED, | 1164 chrome::NOTIFICATION_EXTENSION_PAGE_ACTION_VISIBILITY_CHANGED, |
1165 content::Source<ExtensionAction>(action), | 1165 content::Source<ExtensionAction>(action), |
1166 content::Details<WebContents>(contents)); | 1166 content::Details<WebContents>(contents)); |
1167 } | 1167 } |
1168 } | 1168 } |
1169 } | 1169 } |
1170 } | 1170 } |
1171 | 1171 |
1172 #if defined(OS_WIN) && !defined(USE_AURA) | 1172 #if defined(OS_WIN) && !defined(USE_AURA) |
1173 void LocationBarView::OnMouseEvent(const views::MouseEvent& event, UINT msg) { | 1173 void LocationBarView::OnMouseEvent(const ui::MouseEvent& event, UINT msg) { |
1174 OmniboxViewWin* omnibox_win = GetOmniboxViewWin(location_entry_.get()); | 1174 OmniboxViewWin* omnibox_win = GetOmniboxViewWin(location_entry_.get()); |
1175 if (omnibox_win) { | 1175 if (omnibox_win) { |
1176 UINT flags = event.native_event().wParam; | 1176 UINT flags = event.native_event().wParam; |
1177 gfx::Point screen_point(event.location()); | 1177 gfx::Point screen_point(event.location()); |
1178 ConvertPointToScreen(this, &screen_point); | 1178 ConvertPointToScreen(this, &screen_point); |
1179 omnibox_win->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); | 1179 omnibox_win->HandleExternalMsg(msg, flags, screen_point.ToPOINT()); |
1180 } | 1180 } |
1181 } | 1181 } |
1182 #endif | 1182 #endif |
1183 | 1183 |
(...skipping 315 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1499 } | 1499 } |
1500 | 1500 |
1501 void LocationBarView::CleanupFadeAnimation() { | 1501 void LocationBarView::CleanupFadeAnimation() { |
1502 // Since we're no longer animating we don't need our layer. | 1502 // Since we're no longer animating we don't need our layer. |
1503 SetPaintToLayer(false); | 1503 SetPaintToLayer(false); |
1504 // Bubble labels don't need a transparent background anymore. | 1504 // Bubble labels don't need a transparent background anymore. |
1505 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1505 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1506 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1506 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1507 } | 1507 } |
1508 #endif // USE_AURA | 1508 #endif // USE_AURA |
OLD | NEW |