Chromium Code Reviews| 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()) |
|
karandeepb
2016/04/20 04:08:59
@sky- Can you confirm whether this is ok to do?
| |
| 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 1193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2443 // Message the RootView to do the drag and drop. That way if we're removed | 2443 // Message the RootView to do the drag and drop. That way if we're removed |
| 2444 // the RootView can detect it and avoid calling us back. | 2444 // the RootView can detect it and avoid calling us back. |
| 2445 gfx::Point widget_location(event.location()); | 2445 gfx::Point widget_location(event.location()); |
| 2446 ConvertPointToWidget(this, &widget_location); | 2446 ConvertPointToWidget(this, &widget_location); |
| 2447 widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2447 widget->RunShellDrag(this, data, widget_location, drag_operations, source); |
| 2448 // WARNING: we may have been deleted. | 2448 // WARNING: we may have been deleted. |
| 2449 return true; | 2449 return true; |
| 2450 } | 2450 } |
| 2451 | 2451 |
| 2452 } // namespace views | 2452 } // namespace views |
| OLD | NEW |