OLD | NEW |
1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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/widget/widget_gtk.h" | 5 #include "views/widget/widget_gtk.h" |
6 | 6 |
7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
8 #include "app/gfx/path.h" | 8 #include "app/gfx/path.h" |
9 #include "app/os_exchange_data.h" | 9 #include "app/os_exchange_data.h" |
10 #include "app/os_exchange_data_provider_gtk.h" | 10 #include "app/os_exchange_data_provider_gtk.h" |
(...skipping 247 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
258 //////////////////////////////////////////////////////////////////////////////// | 258 //////////////////////////////////////////////////////////////////////////////// |
259 // WidgetGtk, Widget implementation: | 259 // WidgetGtk, Widget implementation: |
260 | 260 |
261 void WidgetGtk::Init(GtkWidget* parent, | 261 void WidgetGtk::Init(GtkWidget* parent, |
262 const gfx::Rect& bounds) { | 262 const gfx::Rect& bounds) { |
263 if (type_ != TYPE_CHILD) | 263 if (type_ != TYPE_CHILD) |
264 ActiveWindowWatcherX::AddObserver(this); | 264 ActiveWindowWatcherX::AddObserver(this); |
265 // Force creation of the RootView if it hasn't been created yet. | 265 // Force creation of the RootView if it hasn't been created yet. |
266 GetRootView(); | 266 GetRootView(); |
267 | 267 |
268 // TODO(sky): nuke this once toolkit_views becomes chromeos. | |
269 #if !defined(CHROMEOS_TRANSITIONAL) | |
270 default_theme_provider_.reset(new DefaultThemeProvider()); | 268 default_theme_provider_.reset(new DefaultThemeProvider()); |
271 #endif | |
272 | 269 |
273 // Make container here. | 270 // Make container here. |
274 CreateGtkWidget(parent, bounds); | 271 CreateGtkWidget(parent, bounds); |
275 | 272 |
276 if (opacity_ != 255) | 273 if (opacity_ != 255) |
277 SetOpacity(opacity_); | 274 SetOpacity(opacity_); |
278 | 275 |
279 // Make sure we receive our motion events. | 276 // Make sure we receive our motion events. |
280 | 277 |
281 // In general we register most events on the parent of all widgets. At a | 278 // In general we register most events on the parent of all widgets. At a |
(...skipping 1030 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1312 | 1309 |
1313 // static | 1310 // static |
1314 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { | 1311 Widget* Widget::GetWidgetFromNativeWindow(gfx::NativeWindow native_window) { |
1315 gpointer raw_widget = g_object_get_data(G_OBJECT(native_window), kWidgetKey); | 1312 gpointer raw_widget = g_object_get_data(G_OBJECT(native_window), kWidgetKey); |
1316 if (raw_widget) | 1313 if (raw_widget) |
1317 return reinterpret_cast<Widget*>(raw_widget); | 1314 return reinterpret_cast<Widget*>(raw_widget); |
1318 return NULL; | 1315 return NULL; |
1319 } | 1316 } |
1320 | 1317 |
1321 } // namespace views | 1318 } // namespace views |
OLD | NEW |