| 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 "content/browser/renderer_host/render_widget_host_view_aura.h" | 5 #include "content/browser/renderer_host/render_widget_host_view_aura.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "content/browser/renderer_host/backing_store_skia.h" | 8 #include "content/browser/renderer_host/backing_store_skia.h" |
| 9 #include "content/browser/renderer_host/render_widget_host.h" | 9 #include "content/browser/renderer_host/render_widget_host.h" |
| 10 #include "content/browser/renderer_host/web_input_event_aura.h" | 10 #include "content/browser/renderer_host/web_input_event_aura.h" |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 is_fullscreen_(false), | 84 is_fullscreen_(false), |
| 85 popup_parent_host_view_(NULL), | 85 popup_parent_host_view_(NULL), |
| 86 is_loading_(false) { | 86 is_loading_(false) { |
| 87 host_->SetView(this); | 87 host_->SetView(this); |
| 88 window_->SetProperty(aura::kTooltipTextKey, &tooltip_); | 88 window_->SetProperty(aura::kTooltipTextKey, &tooltip_); |
| 89 } | 89 } |
| 90 | 90 |
| 91 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { | 91 RenderWidgetHostViewAura::~RenderWidgetHostViewAura() { |
| 92 } | 92 } |
| 93 | 93 |
| 94 void RenderWidgetHostViewAura::Init() { | 94 void RenderWidgetHostViewAura::InitAsChild() { |
| 95 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); | 95 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); |
| 96 } | 96 } |
| 97 | 97 |
| 98 //////////////////////////////////////////////////////////////////////////////// | 98 //////////////////////////////////////////////////////////////////////////////// |
| 99 // RenderWidgetHostViewAura, RenderWidgetHostView implementation: | 99 // RenderWidgetHostViewAura, RenderWidgetHostView implementation: |
| 100 | 100 |
| 101 void RenderWidgetHostViewAura::InitAsPopup( | 101 void RenderWidgetHostViewAura::InitAsPopup( |
| 102 RenderWidgetHostView* parent_host_view, | 102 RenderWidgetHostView* parent_host_view, |
| 103 const gfx::Rect& pos) { | 103 const gfx::Rect& pos) { |
| 104 popup_parent_host_view_ = | 104 popup_parent_host_view_ = |
| 105 static_cast<RenderWidgetHostViewAura*>(parent_host_view); | 105 static_cast<RenderWidgetHostViewAura*>(parent_host_view); |
| 106 window_->SetType(aura::WINDOW_TYPE_MENU); | 106 window_->SetType(aura::WINDOW_TYPE_MENU); |
| 107 Init(); | 107 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); |
| 108 | 108 |
| 109 window_->SetParent(NULL); | 109 window_->SetParent(NULL); |
| 110 Show(); | 110 Show(); |
| 111 SetBounds(pos); | 111 SetBounds(pos); |
| 112 } | 112 } |
| 113 | 113 |
| 114 void RenderWidgetHostViewAura::InitAsFullscreen( | 114 void RenderWidgetHostViewAura::InitAsFullscreen( |
| 115 RenderWidgetHostView* reference_host_view) { | 115 RenderWidgetHostView* reference_host_view) { |
| 116 is_fullscreen_ = true; |
| 116 window_->SetType(aura::WINDOW_TYPE_POPUP); | 117 window_->SetType(aura::WINDOW_TYPE_POPUP); |
| 117 is_fullscreen_ = true; | 118 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); |
| 118 Init(); | |
| 119 | 119 |
| 120 window_->SetParent(NULL); | 120 window_->SetParent(NULL); |
| 121 window_->Fullscreen(); | 121 window_->Fullscreen(); |
| 122 Show(); | 122 Show(); |
| 123 Focus(); | 123 Focus(); |
| 124 // TODO(derat): The window is visible but it's not being updated. Figure out | 124 // TODO(derat): The window is visible but it's not being updated. Figure out |
| 125 // why. | 125 // why. |
| 126 } | 126 } |
| 127 | 127 |
| 128 RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const { | 128 RenderWidgetHost* RenderWidgetHostViewAura::GetRenderWidgetHost() const { |
| (...skipping 376 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 505 } | 505 } |
| 506 #endif | 506 #endif |
| 507 | 507 |
| 508 //////////////////////////////////////////////////////////////////////////////// | 508 //////////////////////////////////////////////////////////////////////////////// |
| 509 // RenderWidgetHostViewAura, private: | 509 // RenderWidgetHostViewAura, private: |
| 510 | 510 |
| 511 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { | 511 void RenderWidgetHostViewAura::UpdateCursorIfOverSelf() { |
| 512 //NOTIMPLEMENTED(); | 512 //NOTIMPLEMENTED(); |
| 513 // TODO(beng): See RenderWidgetHostViewWin. | 513 // TODO(beng): See RenderWidgetHostViewWin. |
| 514 } | 514 } |
| OLD | NEW |