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 "chrome/views/view.h" | 5 #include "chrome/views/view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #ifndef NDEBUG | 9 #ifndef NDEBUG |
10 #include <iostream> | 10 #include <iostream> |
(...skipping 1154 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1165 } | 1165 } |
1166 return ValidateFloatingViewForID(id); | 1166 return ValidateFloatingViewForID(id); |
1167 } | 1167 } |
1168 | 1168 |
1169 void View::RestoreFloatingViewFocus() { | 1169 void View::RestoreFloatingViewFocus() { |
1170 // Clear the reference to the task as if we have been triggered by it, it will | 1170 // Clear the reference to the task as if we have been triggered by it, it will |
1171 // soon be invalid. | 1171 // soon be invalid. |
1172 restore_focus_view_task_ = NULL; | 1172 restore_focus_view_task_ = NULL; |
1173 should_restore_focus_ = false; | 1173 should_restore_focus_ = false; |
1174 | 1174 |
1175 GetFocusManager()->RestoreFocusedView(); | 1175 FocusManager* focus_manager = GetFocusManager(); |
| 1176 if (focus_manager) |
| 1177 focus_manager->RestoreFocusedView(); |
1176 } | 1178 } |
1177 | 1179 |
1178 // static | 1180 // static |
1179 bool View::EnumerateFloatingViewsForInterval(int low_bound, int high_bound, | 1181 bool View::EnumerateFloatingViewsForInterval(int low_bound, int high_bound, |
1180 bool ascending_order, | 1182 bool ascending_order, |
1181 FloatingViewPosition position, | 1183 FloatingViewPosition position, |
1182 int starting_id, | 1184 int starting_id, |
1183 int* id) { | 1185 int* id) { |
1184 DCHECK(low_bound <= high_bound); | 1186 DCHECK(low_bound <= high_bound); |
1185 if (low_bound >= high_bound) | 1187 if (low_bound >= high_bound) |
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1594 } | 1596 } |
1595 | 1597 |
1596 void View::DragInfo::PossibleDrag(int x, int y) { | 1598 void View::DragInfo::PossibleDrag(int x, int y) { |
1597 possible_drag = true; | 1599 possible_drag = true; |
1598 start_x = x; | 1600 start_x = x; |
1599 start_y = y; | 1601 start_y = y; |
1600 } | 1602 } |
1601 | 1603 |
1602 } // namespace | 1604 } // namespace |
1603 | 1605 |
OLD | NEW |