| 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 199 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 210 | 210 |
| 211 int View::GetIndexOf(const View* view) const { | 211 int View::GetIndexOf(const View* view) const { |
| 212 ViewVector::const_iterator it = std::find(children_.begin(), children_.end(), | 212 ViewVector::const_iterator it = std::find(children_.begin(), children_.end(), |
| 213 view); | 213 view); |
| 214 return it != children_.end() ? it - children_.begin() : -1; | 214 return it != children_.end() ? it - children_.begin() : -1; |
| 215 } | 215 } |
| 216 | 216 |
| 217 // TODO(beng): remove | 217 // TODO(beng): remove |
| 218 const Window* View::GetWindow() const { | 218 const Window* View::GetWindow() const { |
| 219 const Widget* widget = GetWidget(); | 219 const Widget* widget = GetWidget(); |
| 220 return widget ? widget->GetWindow() : NULL; | 220 return widget ? widget->GetContainingWindow() : NULL; |
| 221 } | 221 } |
| 222 | 222 |
| 223 // TODO(beng): remove | 223 // TODO(beng): remove |
| 224 Window* View::GetWindow() { | 224 Window* View::GetWindow() { |
| 225 return const_cast<Window*>(const_cast<const View*>(this)->GetWindow()); | 225 return const_cast<Window*>(const_cast<const View*>(this)->GetWindow()); |
| 226 } | 226 } |
| 227 | 227 |
| 228 // TODO(beng): remove | 228 // TODO(beng): remove |
| 229 bool View::ContainsNativeView(gfx::NativeView native_view) const { | 229 bool View::ContainsNativeView(gfx::NativeView native_view) const { |
| 230 for (int i = 0, count = child_count(); i < count; ++i) { | 230 for (int i = 0, count = child_count(); i < count; ++i) { |
| (...skipping 1692 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1923 result.append(GetChildViewAt(i)->PrintViewGraph(false)); | 1923 result.append(GetChildViewAt(i)->PrintViewGraph(false)); |
| 1924 | 1924 |
| 1925 if (first) | 1925 if (first) |
| 1926 result.append("}\n"); | 1926 result.append("}\n"); |
| 1927 | 1927 |
| 1928 return result; | 1928 return result; |
| 1929 } | 1929 } |
| 1930 #endif | 1930 #endif |
| 1931 | 1931 |
| 1932 } // namespace views | 1932 } // namespace views |
| OLD | NEW |