| 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 1208 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1219   return widget ? widget->GetFocusManager() : NULL; | 1219   return widget ? widget->GetFocusManager() : NULL; | 
| 1220 } | 1220 } | 
| 1221 | 1221 | 
| 1222 const FocusManager* View::GetFocusManager() const { | 1222 const FocusManager* View::GetFocusManager() const { | 
| 1223   const Widget* widget = GetWidget(); | 1223   const Widget* widget = GetWidget(); | 
| 1224   return widget ? widget->GetFocusManager() : NULL; | 1224   return widget ? widget->GetFocusManager() : NULL; | 
| 1225 } | 1225 } | 
| 1226 | 1226 | 
| 1227 void View::RequestFocus() { | 1227 void View::RequestFocus() { | 
| 1228   FocusManager* focus_manager = GetFocusManager(); | 1228   FocusManager* focus_manager = GetFocusManager(); | 
| 1229   if (focus_manager && IsAccessibilityFocusable()) | 1229   if (focus_manager) { | 
| 1230     focus_manager->SetFocusedView(this); | 1230     bool focusable = focus_manager->keyboard_accessible() | 
|  | 1231                          ? IsAccessibilityFocusable() | 
|  | 1232                          : IsFocusable(); | 
|  | 1233     if (focusable) | 
|  | 1234       focus_manager->SetFocusedView(this); | 
|  | 1235   } | 
| 1231 } | 1236 } | 
| 1232 | 1237 | 
| 1233 bool View::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { | 1238 bool View::SkipDefaultKeyEventProcessing(const ui::KeyEvent& event) { | 
| 1234   return false; | 1239   return false; | 
| 1235 } | 1240 } | 
| 1236 | 1241 | 
| 1237 FocusTraversable* View::GetFocusTraversable() { | 1242 FocusTraversable* View::GetFocusTraversable() { | 
| 1238   return NULL; | 1243   return NULL; | 
| 1239 } | 1244 } | 
| 1240 | 1245 | 
| (...skipping 1174 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 2415   // Message the RootView to do the drag and drop. That way if we're removed | 2420   // Message the RootView to do the drag and drop. That way if we're removed | 
| 2416   // the RootView can detect it and avoid calling us back. | 2421   // the RootView can detect it and avoid calling us back. | 
| 2417   gfx::Point widget_location(event.location()); | 2422   gfx::Point widget_location(event.location()); | 
| 2418   ConvertPointToWidget(this, &widget_location); | 2423   ConvertPointToWidget(this, &widget_location); | 
| 2419   widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 2424   widget->RunShellDrag(this, data, widget_location, drag_operations, source); | 
| 2420   // WARNING: we may have been deleted. | 2425   // WARNING: we may have been deleted. | 
| 2421   return true; | 2426   return true; | 
| 2422 } | 2427 } | 
| 2423 | 2428 | 
| 2424 }  // namespace views | 2429 }  // namespace views | 
| OLD | NEW | 
|---|