| 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 1252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1263 | 1263 |
| 1264 void View::Blur() { | 1264 void View::Blur() { |
| 1265 SchedulePaint(); | 1265 SchedulePaint(); |
| 1266 OnBlur(); | 1266 OnBlur(); |
| 1267 } | 1267 } |
| 1268 | 1268 |
| 1269 // Tooltips -------------------------------------------------------------------- | 1269 // Tooltips -------------------------------------------------------------------- |
| 1270 | 1270 |
| 1271 void View::TooltipTextChanged() { | 1271 void View::TooltipTextChanged() { |
| 1272 Widget* widget = GetWidget(); | 1272 Widget* widget = GetWidget(); |
| 1273 if (widget) | 1273 // TooltipManager may be null if there is a problem creating it. |
| 1274 if (widget && widget->native_widget()->GetTooltipManager()) |
| 1274 widget->native_widget()->GetTooltipManager()->TooltipTextChanged(this); | 1275 widget->native_widget()->GetTooltipManager()->TooltipTextChanged(this); |
| 1275 } | 1276 } |
| 1276 | 1277 |
| 1277 // Context menus --------------------------------------------------------------- | 1278 // Context menus --------------------------------------------------------------- |
| 1278 | 1279 |
| 1279 gfx::Point View::GetKeyboardContextMenuLocation() { | 1280 gfx::Point View::GetKeyboardContextMenuLocation() { |
| 1280 gfx::Rect vis_bounds = GetVisibleBounds(); | 1281 gfx::Rect vis_bounds = GetVisibleBounds(); |
| 1281 gfx::Point screen_point(vis_bounds.x() + vis_bounds.width() / 2, | 1282 gfx::Point screen_point(vis_bounds.x() + vis_bounds.width() / 2, |
| 1282 vis_bounds.y() + vis_bounds.height() / 2); | 1283 vis_bounds.y() + vis_bounds.height() / 2); |
| 1283 ConvertPointToScreen(this, &screen_point); | 1284 ConvertPointToScreen(this, &screen_point); |
| (...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1868 result.append(GetChildViewAt(i)->PrintViewGraph(false)); | 1869 result.append(GetChildViewAt(i)->PrintViewGraph(false)); |
| 1869 | 1870 |
| 1870 if (first) | 1871 if (first) |
| 1871 result.append("}\n"); | 1872 result.append("}\n"); |
| 1872 | 1873 |
| 1873 return result; | 1874 return result; |
| 1874 } | 1875 } |
| 1875 #endif | 1876 #endif |
| 1876 | 1877 |
| 1877 } // namespace views | 1878 } // namespace views |
| OLD | NEW |