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 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. | 5 #define _USE_MATH_DEFINES // For VC++ to get M_PI. This has to be first. |
6 | 6 |
7 #include "ui/views/view.h" | 7 #include "ui/views/view.h" |
8 | 8 |
9 #include <algorithm> | 9 #include <algorithm> |
10 #include <cmath> | 10 #include <cmath> |
(...skipping 1218 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1229 return widget ? widget->GetFocusManager() : NULL; | 1229 return widget ? widget->GetFocusManager() : NULL; |
1230 } | 1230 } |
1231 | 1231 |
1232 const FocusManager* View::GetFocusManager() const { | 1232 const FocusManager* View::GetFocusManager() const { |
1233 const Widget* widget = GetWidget(); | 1233 const Widget* widget = GetWidget(); |
1234 return widget ? widget->GetFocusManager() : NULL; | 1234 return widget ? widget->GetFocusManager() : NULL; |
1235 } | 1235 } |
1236 | 1236 |
1237 void View::RequestFocus() { | 1237 void View::RequestFocus() { |
1238 FocusManager* focus_manager = GetFocusManager(); | 1238 FocusManager* focus_manager = GetFocusManager(); |
1239 if (focus_manager && IsFocusable()) | 1239 if (focus_manager && IsAccessibilityFocusable()) |
1240 focus_manager->SetFocusedView(this); | 1240 focus_manager->SetFocusedView(this); |
1241 } | 1241 } |
1242 | 1242 |
1243 bool View::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { | 1243 bool View::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { |
1244 return false; | 1244 return false; |
1245 } | 1245 } |
1246 | 1246 |
1247 FocusTraversable* View::GetFocusTraversable() { | 1247 FocusTraversable* View::GetFocusTraversable() { |
1248 return NULL; | 1248 return NULL; |
1249 } | 1249 } |
(...skipping 1191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2441 // Message the RootView to do the drag and drop. That way if we're removed | 2441 // Message the RootView to do the drag and drop. That way if we're removed |
2442 // the RootView can detect it and avoid calling us back. | 2442 // the RootView can detect it and avoid calling us back. |
2443 gfx::Point widget_location(event.location()); | 2443 gfx::Point widget_location(event.location()); |
2444 ConvertPointToWidget(this, &widget_location); | 2444 ConvertPointToWidget(this, &widget_location); |
2445 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2445 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
2446 // WARNING: we may have been deleted. | 2446 // WARNING: we may have been deleted. |
2447 return true; | 2447 return true; |
2448 } | 2448 } |
2449 | 2449 |
2450 } // namespace views | 2450 } // namespace views |
OLD | NEW |