Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/bind.h" | 9 #include "base/bind.h" |
| 10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
| (...skipping 840 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 851 int64 old = GetPropertyInternal(key, default_value); | 851 int64 old = GetPropertyInternal(key, default_value); |
| 852 if (value == default_value) { | 852 if (value == default_value) { |
| 853 prop_map_.erase(key); | 853 prop_map_.erase(key); |
| 854 } else { | 854 } else { |
| 855 Value prop_value; | 855 Value prop_value; |
| 856 prop_value.name = name; | 856 prop_value.name = name; |
| 857 prop_value.value = value; | 857 prop_value.value = value; |
| 858 prop_value.deallocator = deallocator; | 858 prop_value.deallocator = deallocator; |
| 859 prop_map_[key] = prop_value; | 859 prop_map_[key] = prop_value; |
| 860 } | 860 } |
| 861 if (delegate_) | |
| 862 delegate_->OnPropertyChanged(key, old); | |
|
sky
2014/08/06 17:23:00
Make NativeWidgetAura a WindowObserver so that you
jackhou1
2014/08/11 05:41:06
Done.
Ah, thanks, that's much simpler.
| |
| 861 FOR_EACH_OBSERVER(WindowObserver, observers_, | 863 FOR_EACH_OBSERVER(WindowObserver, observers_, |
| 862 OnWindowPropertyChanged(this, key, old)); | 864 OnWindowPropertyChanged(this, key, old)); |
| 863 return old; | 865 return old; |
| 864 } | 866 } |
| 865 | 867 |
| 866 int64 Window::GetPropertyInternal(const void* key, | 868 int64 Window::GetPropertyInternal(const void* key, |
| 867 int64 default_value) const { | 869 int64 default_value) const { |
| 868 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); | 870 std::map<const void*, Value>::const_iterator iter = prop_map_.find(key); |
| 869 if (iter == prop_map_.end()) | 871 if (iter == prop_map_.end()) |
| 870 return default_value; | 872 return default_value; |
| (...skipping 572 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1443 return window; | 1445 return window; |
| 1444 if (offset) | 1446 if (offset) |
| 1445 *offset += window->bounds().OffsetFromOrigin(); | 1447 *offset += window->bounds().OffsetFromOrigin(); |
| 1446 } | 1448 } |
| 1447 if (offset) | 1449 if (offset) |
| 1448 *offset = gfx::Vector2d(); | 1450 *offset = gfx::Vector2d(); |
| 1449 return NULL; | 1451 return NULL; |
| 1450 } | 1452 } |
| 1451 | 1453 |
| 1452 } // namespace aura | 1454 } // namespace aura |
| OLD | NEW |