Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(148)

Unified Diff: views/widget/native_widget_aura.cc

Issue 8289022: Wires keeping the launcher up to date with the browser. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Tweaks Created 9 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: views/widget/native_widget_aura.cc
diff --git a/views/widget/native_widget_aura.cc b/views/widget/native_widget_aura.cc
index b3673a03239e1ee0ae28d61bb5232068a3c8bdea..1158e7bbc4db511f7c263ad23c85935282117315 100644
--- a/views/widget/native_widget_aura.cc
+++ b/views/widget/native_widget_aura.cc
@@ -9,6 +9,7 @@
#include "ui/aura/event.h"
#include "ui/aura/window.h"
#include "ui/aura/window_types.h"
+#include "ui/base/view_prop.h"
#include "ui/base/ui_base_types.h"
#include "ui/gfx/canvas.h"
#include "ui/gfx/compositor/layer.h"
@@ -28,6 +29,8 @@
#include "views/ime/mock_input_method.h"
#endif
+using ui::ViewProp;
+
namespace views {
namespace {
@@ -173,15 +176,24 @@ void NativeWidgetAura::ViewRemoved(View* view) {
}
void NativeWidgetAura::SetNativeWindowProperty(const char* name, void* value) {
- if (!value)
- props_map_.erase(name);
- else
- props_map_[name] = value;
+ // TODO(sky): push this to Widget when we get rid of NativeWidgetGtk.
+ if (!window_)
+ return;
+
+ // Remove the existing property (if any).
+ for (ViewProps::iterator i = props_.begin(); i != props_.end(); ++i) {
+ if ((*i)->Key() == name) {
+ props_.erase(i);
+ break;
+ }
+ }
+
+ if (value)
+ props_.push_back(new ViewProp(window_, name, value));
}
void* NativeWidgetAura::GetNativeWindowProperty(const char* name) const {
- PropsMap::const_iterator i = props_map_.find(name);
- return i == props_map_.end() ? NULL : i->second;
+ return window_ ? ViewProp::GetValue(window_, name) : NULL;
}
TooltipManager* NativeWidgetAura::GetTooltipManager() const {
@@ -538,6 +550,7 @@ void NativeWidgetAura::OnWindowDestroying() {
}
void NativeWidgetAura::OnWindowDestroyed() {
+ props_.reset();
window_ = NULL;
delegate_->OnNativeWidgetDestroyed();
if (ownership_ == Widget::InitParams::NATIVE_WIDGET_OWNS_WIDGET)
« no previous file with comments | « views/widget/native_widget_aura.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698