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/controls/native/native_view_host_gtk.h" | 5 #include "views/controls/native/native_view_host_gtk.h" |
6 | 6 |
7 #include <gtk/gtk.h> | 7 #include <gtk/gtk.h> |
8 #include <algorithm> | 8 #include <algorithm> |
9 | 9 |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
316 gtk_container_remove(GTK_CONTAINER(fixed_), host_->native_view()); | 316 gtk_container_remove(GTK_CONTAINER(fixed_), host_->native_view()); |
317 } | 317 } |
318 // fixed_ should not have any children this point. | 318 // fixed_ should not have any children this point. |
319 DCHECK_EQ(0U, | 319 DCHECK_EQ(0U, |
320 g_list_length(gtk_container_get_children(GTK_CONTAINER(fixed_)))); | 320 g_list_length(gtk_container_get_children(GTK_CONTAINER(fixed_)))); |
321 gtk_widget_destroy(fixed_); | 321 gtk_widget_destroy(fixed_); |
322 fixed_ = NULL; | 322 fixed_ = NULL; |
323 } | 323 } |
324 | 324 |
325 WidgetGtk* NativeViewHostGtk::GetHostWidget() const { | 325 WidgetGtk* NativeViewHostGtk::GetHostWidget() const { |
326 return static_cast<WidgetGtk*>(host_->GetWidget()); | 326 return static_cast<WidgetGtk*>(host_->GetWidget()->native_widget()); |
327 } | 327 } |
328 | 328 |
329 GtkWidget* NativeViewHostGtk::GetFocusedDescendant() { | 329 GtkWidget* NativeViewHostGtk::GetFocusedDescendant() { |
330 if (!fixed_) | 330 if (!fixed_) |
331 return NULL; | 331 return NULL; |
332 WidgetGtk* host = GetHostWidget(); | 332 WidgetGtk* host = GetHostWidget(); |
333 if (!host) | 333 if (!host) |
334 return NULL; | 334 return NULL; |
335 GtkWidget* top_level = gtk_widget_get_toplevel(host->GetNativeView()); | 335 GtkWidget* top_level = gtk_widget_get_toplevel(host->GetNativeView()); |
336 if (!top_level || !GTK_IS_WINDOW(top_level)) | 336 if (!top_level || !GTK_IS_WINDOW(top_level)) |
(...skipping 31 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 //////////////////////////////////////////////////////////////////////////////// | 368 //////////////////////////////////////////////////////////////////////////////// |
369 // NativeViewHostWrapper, public: | 369 // NativeViewHostWrapper, public: |
370 | 370 |
371 // static | 371 // static |
372 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 372 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( |
373 NativeViewHost* host) { | 373 NativeViewHost* host) { |
374 return new NativeViewHostGtk(host); | 374 return new NativeViewHostGtk(host); |
375 } | 375 } |
376 | 376 |
377 } // namespace views | 377 } // namespace views |
OLD | NEW |