| 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/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 146 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 157     fixed_w = std::min(installed_clip_bounds_.width(), w); | 157     fixed_w = std::min(installed_clip_bounds_.width(), w); | 
| 158     fixed_h = std::min(installed_clip_bounds_.height(), h); | 158     fixed_h = std::min(installed_clip_bounds_.height(), h); | 
| 159   } | 159   } | 
| 160 | 160 | 
| 161   // Size and place the fixed_. | 161   // Size and place the fixed_. | 
| 162   GetHostWidget()->PositionChild(fixed_, fixed_x, fixed_y, fixed_w, fixed_h); | 162   GetHostWidget()->PositionChild(fixed_, fixed_x, fixed_y, fixed_w, fixed_h); | 
| 163 | 163 | 
| 164   // Size and place the hosted NativeView. | 164   // Size and place the hosted NativeView. | 
| 165   gtk_widget_set_size_request(host_->native_view(), child_w, child_h); | 165   gtk_widget_set_size_request(host_->native_view(), child_w, child_h); | 
| 166   gtk_fixed_move(GTK_FIXED(fixed_), host_->native_view(), child_x, child_y); | 166   gtk_fixed_move(GTK_FIXED(fixed_), host_->native_view(), child_x, child_y); | 
| 167   GtkAllocation alloc = { child_x, child_y, child_w, child_y}; |  | 
| 168   gtk_widget_size_allocate(host_->native_view(), &alloc); |  | 
| 169 | 167 | 
| 170   gtk_widget_show(fixed_); | 168   gtk_widget_show(fixed_); | 
| 171   gtk_widget_show(host_->native_view()); | 169   gtk_widget_show(host_->native_view()); | 
| 172 } | 170 } | 
| 173 | 171 | 
| 174 void NativeViewHostGtk::HideWidget() { | 172 void NativeViewHostGtk::HideWidget() { | 
| 175   gtk_widget_hide(fixed_); | 173   gtk_widget_hide(fixed_); | 
| 176 } | 174 } | 
| 177 | 175 | 
| 178 void NativeViewHostGtk::SetFocus() { | 176 void NativeViewHostGtk::SetFocus() { | 
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 281 //////////////////////////////////////////////////////////////////////////////// | 279 //////////////////////////////////////////////////////////////////////////////// | 
| 282 // NativeViewHostWrapper, public: | 280 // NativeViewHostWrapper, public: | 
| 283 | 281 | 
| 284 // static | 282 // static | 
| 285 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 283 NativeViewHostWrapper* NativeViewHostWrapper::CreateWrapper( | 
| 286     NativeViewHost* host) { | 284     NativeViewHost* host) { | 
| 287   return new NativeViewHostGtk(host); | 285   return new NativeViewHostGtk(host); | 
| 288 } | 286 } | 
| 289 | 287 | 
| 290 }  // namespace views | 288 }  // namespace views | 
| OLD | NEW | 
|---|