| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "views/view.h" | 5 #include "views/view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #ifndef NDEBUG | 8 #ifndef NDEBUG |
| 9 #include <iostream> | 9 #include <iostream> |
| 10 #endif | 10 #endif |
| (...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 257 } | 257 } |
| 258 | 258 |
| 259 bool View::IsFocusable() const { | 259 bool View::IsFocusable() const { |
| 260 return focusable_ && enabled_ && is_visible_; | 260 return focusable_ && enabled_ && is_visible_; |
| 261 } | 261 } |
| 262 | 262 |
| 263 void View::SetFocusable(bool focusable) { | 263 void View::SetFocusable(bool focusable) { |
| 264 focusable_ = focusable; | 264 focusable_ = focusable; |
| 265 } | 265 } |
| 266 | 266 |
| 267 FocusManager* View::GetFocusManager() { |
| 268 Widget* widget = GetWidget(); |
| 269 return widget ? widget->GetFocusManager() : NULL; |
| 270 } |
| 271 |
| 267 bool View::HasFocus() { | 272 bool View::HasFocus() { |
| 268 FocusManager* focus_manager = GetFocusManager(); | 273 FocusManager* focus_manager = GetFocusManager(); |
| 269 if (focus_manager) | 274 if (focus_manager) |
| 270 return focus_manager->GetFocusedView() == this; | 275 return focus_manager->GetFocusedView() == this; |
| 271 return false; | 276 return false; |
| 272 } | 277 } |
| 273 | 278 |
| 274 void View::SetHotTracked(bool flag) { | 279 void View::SetHotTracked(bool flag) { |
| 275 } | 280 } |
| 276 | 281 |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1392 start_x = start_y = 0; | 1397 start_x = start_y = 0; |
| 1393 } | 1398 } |
| 1394 | 1399 |
| 1395 void View::DragInfo::PossibleDrag(int x, int y) { | 1400 void View::DragInfo::PossibleDrag(int x, int y) { |
| 1396 possible_drag = true; | 1401 possible_drag = true; |
| 1397 start_x = x; | 1402 start_x = x; |
| 1398 start_y = y; | 1403 start_y = y; |
| 1399 } | 1404 } |
| 1400 | 1405 |
| 1401 } // namespace | 1406 } // namespace |
| OLD | NEW |