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 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
56 #include "chrome/common/chrome_switches.h" | 56 #include "chrome/common/chrome_switches.h" |
57 #include "chrome/common/extensions/extension_switch_utils.h" | 57 #include "chrome/common/extensions/extension_switch_utils.h" |
58 #include "chrome/common/pref_names.h" | 58 #include "chrome/common/pref_names.h" |
59 #include "content/public/browser/notification_service.h" | 59 #include "content/public/browser/notification_service.h" |
60 #include "content/public/browser/render_widget_host_view.h" | 60 #include "content/public/browser/render_widget_host_view.h" |
61 #include "content/public/browser/web_contents.h" | 61 #include "content/public/browser/web_contents.h" |
62 #include "grit/generated_resources.h" | 62 #include "grit/generated_resources.h" |
63 #include "grit/theme_resources.h" | 63 #include "grit/theme_resources.h" |
64 #include "ui/base/accessibility/accessible_view_state.h" | 64 #include "ui/base/accessibility/accessible_view_state.h" |
65 #include "ui/base/dragdrop/drag_drop_types.h" | 65 #include "ui/base/dragdrop/drag_drop_types.h" |
| 66 #include "ui/base/event.h" |
66 #include "ui/base/l10n/l10n_util.h" | 67 #include "ui/base/l10n/l10n_util.h" |
67 #include "ui/base/layout.h" | 68 #include "ui/base/layout.h" |
68 #include "ui/base/resource/resource_bundle.h" | 69 #include "ui/base/resource/resource_bundle.h" |
69 #include "ui/base/theme_provider.h" | 70 #include "ui/base/theme_provider.h" |
70 #include "ui/gfx/canvas.h" | 71 #include "ui/gfx/canvas.h" |
71 #include "ui/gfx/color_utils.h" | 72 #include "ui/gfx/color_utils.h" |
72 #include "ui/gfx/image/image.h" | 73 #include "ui/gfx/image/image.h" |
73 #include "ui/gfx/skia_util.h" | 74 #include "ui/gfx/skia_util.h" |
74 #include "ui/views/border.h" | 75 #include "ui/views/border.h" |
75 #include "ui/views/button_drag_utils.h" | 76 #include "ui/views/button_drag_utils.h" |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1208 gfx::Point line_end(bounds.origin()); | 1209 gfx::Point line_end(bounds.origin()); |
1209 line_end.Offset(0, bounds.height()); | 1210 line_end.Offset(0, bounds.height()); |
1210 canvas->DrawLine(bounds.origin(), line_end, | 1211 canvas->DrawLine(bounds.origin(), line_end, |
1211 action_box_button_view_->GetBorderColor()); | 1212 action_box_button_view_->GetBorderColor()); |
1212 } | 1213 } |
1213 | 1214 |
1214 std::string LocationBarView::GetClassName() const { | 1215 std::string LocationBarView::GetClassName() const { |
1215 return kViewClassName; | 1216 return kViewClassName; |
1216 } | 1217 } |
1217 | 1218 |
1218 bool LocationBarView::SkipDefaultKeyEventProcessing( | 1219 bool LocationBarView::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { |
1219 const views::KeyEvent& event) { | |
1220 #if defined(OS_WIN) | 1220 #if defined(OS_WIN) |
1221 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { | 1221 if (views::FocusManager::IsTabTraversalKeyEvent(event)) { |
1222 if (location_entry_->model()->popup_model()->IsOpen()) { | 1222 if (location_entry_->model()->popup_model()->IsOpen()) { |
1223 // Return true so that the edit sees the tab and moves the selection. | 1223 // Return true so that the edit sees the tab and moves the selection. |
1224 return true; | 1224 return true; |
1225 } | 1225 } |
1226 if (keyword_hint_view_->visible() && !event.IsShiftDown()) { | 1226 if (keyword_hint_view_->visible() && !event.IsShiftDown()) { |
1227 // Return true so the edit gets the tab event and enters keyword mode. | 1227 // Return true so the edit gets the tab event and enters keyword mode. |
1228 return true; | 1228 return true; |
1229 } | 1229 } |
(...skipping 267 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1497 } | 1497 } |
1498 | 1498 |
1499 void LocationBarView::CleanupFadeAnimation() { | 1499 void LocationBarView::CleanupFadeAnimation() { |
1500 // Since we're no longer animating we don't need our layer. | 1500 // Since we're no longer animating we don't need our layer. |
1501 SetPaintToLayer(false); | 1501 SetPaintToLayer(false); |
1502 // Bubble labels don't need a transparent background anymore. | 1502 // Bubble labels don't need a transparent background anymore. |
1503 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1503 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1504 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1504 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
1505 } | 1505 } |
1506 #endif // USE_AURA | 1506 #endif // USE_AURA |
OLD | NEW |