| 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 "ui/aura/window.h" | 5 #include "ui/aura/window.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/logging.h" | 9 #include "base/logging.h" |
| 10 #include "base/stl_util.h" | 10 #include "base/stl_util.h" |
| (...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 403 Desktop* desktop = GetDesktop(); | 403 Desktop* desktop = GetDesktop(); |
| 404 return desktop && desktop->capture_window() == this; | 404 return desktop && desktop->capture_window() == this; |
| 405 } | 405 } |
| 406 | 406 |
| 407 void Window::SetProperty(const char* name, void* value) { | 407 void Window::SetProperty(const char* name, void* value) { |
| 408 void* old = GetProperty(name); | 408 void* old = GetProperty(name); |
| 409 if (value) | 409 if (value) |
| 410 prop_map_[name] = value; | 410 prop_map_[name] = value; |
| 411 else | 411 else |
| 412 prop_map_.erase(name); | 412 prop_map_.erase(name); |
| 413 FOR_EACH_OBSERVER(WindowObserver, observers_, | 413 FOR_EACH_OBSERVER( |
| 414 OnPropertyChanged(this, name, old)); | 414 WindowObserver, observers_, OnWindowPropertyChanged(this, name, old)); |
| 415 } | 415 } |
| 416 | 416 |
| 417 void Window::SetIntProperty(const char* name, int value) { | 417 void Window::SetIntProperty(const char* name, int value) { |
| 418 SetProperty(name, reinterpret_cast<void*>(value)); | 418 SetProperty(name, reinterpret_cast<void*>(value)); |
| 419 } | 419 } |
| 420 | 420 |
| 421 void* Window::GetProperty(const char* name) const { | 421 void* Window::GetProperty(const char* name) const { |
| 422 std::map<const char*, void*>::const_iterator iter = prop_map_.find(name); | 422 std::map<const char*, void*>::const_iterator iter = prop_map_.find(name); |
| 423 if (iter == prop_map_.end()) | 423 if (iter == prop_map_.end()) |
| 424 return NULL; | 424 return NULL; |
| (...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 533 void Window::OnStackingChanged() { | 533 void Window::OnStackingChanged() { |
| 534 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowStackingChanged(this)); | 534 FOR_EACH_OBSERVER(WindowObserver, observers_, OnWindowStackingChanged(this)); |
| 535 } | 535 } |
| 536 | 536 |
| 537 void Window::OnPaintLayer(gfx::Canvas* canvas) { | 537 void Window::OnPaintLayer(gfx::Canvas* canvas) { |
| 538 if (delegate_) | 538 if (delegate_) |
| 539 delegate_->OnPaint(canvas); | 539 delegate_->OnPaint(canvas); |
| 540 } | 540 } |
| 541 | 541 |
| 542 } // namespace aura | 542 } // namespace aura |
| OLD | NEW |