| 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 |
| 11 | 11 |
| 12 #include "app/drag_drop_types.h" | 12 #include "app/drag_drop_types.h" |
| 13 #include "app/gfx/canvas.h" | 13 #include "app/gfx/canvas.h" |
| 14 #include "app/l10n_util.h" | 14 #include "app/l10n_util.h" |
| 15 #include "base/logging.h" | 15 #include "base/logging.h" |
| 16 #include "base/message_loop.h" | 16 #include "base/message_loop.h" |
| 17 #include "base/scoped_handle.h" | 17 #include "base/scoped_handle.h" |
| 18 #include "base/string_util.h" | 18 #include "base/string_util.h" |
| 19 #include "third_party/skia/include/core/SkShader.h" | 19 #include "third_party/skia/include/core/SkShader.h" |
| 20 #include "views/background.h" | 20 #include "views/background.h" |
| 21 #include "views/layout_manager.h" | 21 #include "views/layout_manager.h" |
| 22 #include "views/views_delegate.h" | 22 #include "views/views_delegate.h" |
| 23 #include "views/widget/root_view.h" | 23 #include "views/widget/root_view.h" |
| 24 #include "views/widget/tooltip_manager.h" |
| 24 #include "views/widget/widget.h" | 25 #include "views/widget/widget.h" |
| 25 #include "views/window/window.h" | 26 #include "views/window/window.h" |
| 26 #if defined(OS_WIN) | 27 #if defined(OS_WIN) |
| 27 #include "views/widget/tooltip_manager.h" | |
| 28 #include "views/accessibility/view_accessibility_wrapper.h" | 28 #include "views/accessibility/view_accessibility_wrapper.h" |
| 29 #endif | 29 #endif |
| 30 | 30 |
| 31 namespace views { | 31 namespace views { |
| 32 | 32 |
| 33 // static | 33 // static |
| 34 ViewsDelegate* ViewsDelegate::views_delegate = NULL; | 34 ViewsDelegate* ViewsDelegate::views_delegate = NULL; |
| 35 | 35 |
| 36 // static | 36 // static |
| 37 char View::kViewClassName[] = "views/View"; | 37 char View::kViewClassName[] = "views/View"; |
| (...skipping 1177 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1215 // Tooltips ----------------------------------------------------------------- | 1215 // Tooltips ----------------------------------------------------------------- |
| 1216 bool View::GetTooltipText(int x, int y, std::wstring* tooltip) { | 1216 bool View::GetTooltipText(int x, int y, std::wstring* tooltip) { |
| 1217 return false; | 1217 return false; |
| 1218 } | 1218 } |
| 1219 | 1219 |
| 1220 bool View::GetTooltipTextOrigin(int x, int y, gfx::Point* loc) { | 1220 bool View::GetTooltipTextOrigin(int x, int y, gfx::Point* loc) { |
| 1221 return false; | 1221 return false; |
| 1222 } | 1222 } |
| 1223 | 1223 |
| 1224 void View::TooltipTextChanged() { | 1224 void View::TooltipTextChanged() { |
| 1225 #if defined(OS_WIN) | |
| 1226 Widget* widget = GetWidget(); | 1225 Widget* widget = GetWidget(); |
| 1227 if (widget && widget->GetTooltipManager()) | 1226 if (widget && widget->GetTooltipManager()) |
| 1228 widget->GetTooltipManager()->TooltipTextChanged(this); | 1227 widget->GetTooltipManager()->TooltipTextChanged(this); |
| 1229 #else | |
| 1230 // TODO(port): Not actually windows specific; I just haven't ported this part | |
| 1231 // yet. | |
| 1232 NOTIMPLEMENTED(); | |
| 1233 #endif | |
| 1234 } | 1228 } |
| 1235 | 1229 |
| 1236 void View::UpdateTooltip() { | 1230 void View::UpdateTooltip() { |
| 1237 #if defined(OS_WIN) | |
| 1238 Widget* widget = GetWidget(); | 1231 Widget* widget = GetWidget(); |
| 1239 if (widget && widget->GetTooltipManager()) | 1232 if (widget && widget->GetTooltipManager()) |
| 1240 widget->GetTooltipManager()->UpdateTooltip(); | 1233 widget->GetTooltipManager()->UpdateTooltip(); |
| 1241 #else | |
| 1242 // TODO(port): Not actually windows specific; I just haven't ported this part | |
| 1243 // yet. | |
| 1244 NOTIMPLEMENTED(); | |
| 1245 #endif | |
| 1246 } | 1234 } |
| 1247 | 1235 |
| 1248 void View::SetParentOwned(bool f) { | 1236 void View::SetParentOwned(bool f) { |
| 1249 is_parent_owned_ = f; | 1237 is_parent_owned_ = f; |
| 1250 } | 1238 } |
| 1251 | 1239 |
| 1252 bool View::IsParentOwned() const { | 1240 bool View::IsParentOwned() const { |
| 1253 return is_parent_owned_; | 1241 return is_parent_owned_; |
| 1254 } | 1242 } |
| 1255 | 1243 |
| (...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1356 start_x = start_y = 0; | 1344 start_x = start_y = 0; |
| 1357 } | 1345 } |
| 1358 | 1346 |
| 1359 void View::DragInfo::PossibleDrag(int x, int y) { | 1347 void View::DragInfo::PossibleDrag(int x, int y) { |
| 1360 possible_drag = true; | 1348 possible_drag = true; |
| 1361 start_x = x; | 1349 start_x = x; |
| 1362 start_y = y; | 1350 start_y = y; |
| 1363 } | 1351 } |
| 1364 | 1352 |
| 1365 } // namespace | 1353 } // namespace |
| OLD | NEW |