| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/memory/scoped_ptr.h" | 10 #include "base/memory/scoped_ptr.h" |
| (...skipping 1223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1234 | 1234 |
| 1235 void View::Blur() { | 1235 void View::Blur() { |
| 1236 SchedulePaint(); | 1236 SchedulePaint(); |
| 1237 OnBlur(); | 1237 OnBlur(); |
| 1238 } | 1238 } |
| 1239 | 1239 |
| 1240 // Tooltips -------------------------------------------------------------------- | 1240 // Tooltips -------------------------------------------------------------------- |
| 1241 | 1241 |
| 1242 void View::TooltipTextChanged() { | 1242 void View::TooltipTextChanged() { |
| 1243 Widget* widget = GetWidget(); | 1243 Widget* widget = GetWidget(); |
| 1244 if (widget) | 1244 // TooltipManager may be null if there is a problem creating it. |
| 1245 if (widget && widget->native_widget()->GetTooltipManager()) |
| 1245 widget->native_widget()->GetTooltipManager()->TooltipTextChanged(this); | 1246 widget->native_widget()->GetTooltipManager()->TooltipTextChanged(this); |
| 1246 } | 1247 } |
| 1247 | 1248 |
| 1248 // Context menus --------------------------------------------------------------- | 1249 // Context menus --------------------------------------------------------------- |
| 1249 | 1250 |
| 1250 gfx::Point View::GetKeyboardContextMenuLocation() { | 1251 gfx::Point View::GetKeyboardContextMenuLocation() { |
| 1251 gfx::Rect vis_bounds = GetVisibleBounds(); | 1252 gfx::Rect vis_bounds = GetVisibleBounds(); |
| 1252 gfx::Point screen_point(vis_bounds.x() + vis_bounds.width() / 2, | 1253 gfx::Point screen_point(vis_bounds.x() + vis_bounds.width() / 2, |
| 1253 vis_bounds.y() + vis_bounds.height() / 2); | 1254 vis_bounds.y() + vis_bounds.height() / 2); |
| 1254 ConvertPointToScreen(this, &screen_point); | 1255 ConvertPointToScreen(this, &screen_point); |
| (...skipping 579 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1834 result.append(GetChildViewAt(i)->PrintViewGraph(false)); | 1835 result.append(GetChildViewAt(i)->PrintViewGraph(false)); |
| 1835 | 1836 |
| 1836 if (first) | 1837 if (first) |
| 1837 result.append("}\n"); | 1838 result.append("}\n"); |
| 1838 | 1839 |
| 1839 return result; | 1840 return result; |
| 1840 } | 1841 } |
| 1841 #endif | 1842 #endif |
| 1842 | 1843 |
| 1843 } // namespace views | 1844 } // namespace views |
| OLD | NEW |