| 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 | |
| 272 bool View::HasFocus() { | 267 bool View::HasFocus() { |
| 273 FocusManager* focus_manager = GetFocusManager(); | 268 FocusManager* focus_manager = GetFocusManager(); |
| 274 if (focus_manager) | 269 if (focus_manager) |
| 275 return focus_manager->GetFocusedView() == this; | 270 return focus_manager->GetFocusedView() == this; |
| 276 return false; | 271 return false; |
| 277 } | 272 } |
| 278 | 273 |
| 279 void View::SetHotTracked(bool flag) { | 274 void View::SetHotTracked(bool flag) { |
| 280 } | 275 } |
| 281 | 276 |
| (...skipping 1115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1397 start_x = start_y = 0; | 1392 start_x = start_y = 0; |
| 1398 } | 1393 } |
| 1399 | 1394 |
| 1400 void View::DragInfo::PossibleDrag(int x, int y) { | 1395 void View::DragInfo::PossibleDrag(int x, int y) { |
| 1401 possible_drag = true; | 1396 possible_drag = true; |
| 1402 start_x = x; | 1397 start_x = x; |
| 1403 start_y = y; | 1398 start_y = y; |
| 1404 } | 1399 } |
| 1405 | 1400 |
| 1406 } // namespace | 1401 } // namespace |
| OLD | NEW |