OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. |
| 4 |
| 5 #include "views/controls/native/native_view_host_views.h" |
| 6 |
| 7 #include "base/logging.h" |
| 8 #include "gfx/canvas.h" |
| 9 #include "views/controls/native/native_view_host.h" |
| 10 #include "views/focus/focus_manager.h" |
| 11 #include "views/widget/root_view.h" |
| 12 #include "views/widget/widget.h" |
| 13 |
| 14 namespace views { |
| 15 |
| 16 //////////////////////////////////////////////////////////////////////////////// |
| 17 // NativeViewHostViews, public: |
| 18 |
| 19 NativeViewHostViews::NativeViewHostViews(NativeViewHost* host) |
| 20 : host_(host), |
| 21 installed_clip_(false) { |
| 22 } |
| 23 |
| 24 NativeViewHostViews::~NativeViewHostViews() { |
| 25 NOTIMPLEMENTED(); |
| 26 } |
| 27 |
| 28 //////////////////////////////////////////////////////////////////////////////// |
| 29 // NativeViewHostViews, NativeViewHostWrapper implementation: |
| 30 void NativeViewHostViews::NativeViewAttached() { |
| 31 host_->AddChildView(host_->views_view()); |
| 32 host_->Layout(); |
| 33 } |
| 34 |
| 35 void NativeViewHostViews::NativeViewDetaching(bool destroyed) { |
| 36 host_->RemoveChildView(host_->views_view()); |
| 37 } |
| 38 |
| 39 void NativeViewHostViews::AddedToWidget() { |
| 40 // nothing to do |
| 41 } |
| 42 |
| 43 void NativeViewHostViews::RemovedFromWidget() { |
| 44 // nothing to do |
| 45 } |
| 46 |
| 47 void NativeViewHostViews::InstallClip(int x, int y, int w, int h) { |
| 48 NOTIMPLEMENTED(); |
| 49 } |
| 50 |
| 51 bool NativeViewHostViews::HasInstalledClip() { |
| 52 return installed_clip_; |
| 53 } |
| 54 |
| 55 void NativeViewHostViews::UninstallClip() { |
| 56 installed_clip_ = false; |
| 57 } |
| 58 |
| 59 void NativeViewHostViews::ShowWidget(int x, int y, int w, int h) { |
| 60 // x, y are in the coordinate system of the root view, but we're |
| 61 // already properly positioned by virtue of being an actual views |
| 62 // child of the NativeHostView, so disregard the origin. |
| 63 host_->views_view()->SetBounds(0, 0, w, h); |
| 64 host_->views_view()->SetVisible(true); |
| 65 } |
| 66 |
| 67 void NativeViewHostViews::HideWidget() { |
| 68 host_->views_view()->SetVisible(false); |
| 69 } |
| 70 |
| 71 void NativeViewHostViews::SetFocus() { |
| 72 host_->views_view()->RequestFocus(); |
| 73 } |
| 74 |
| 75 } // namespace views |
OLD | NEW |