Index: content/browser/renderer_host/render_widget_host_view_aura.cc |
diff --git a/content/browser/renderer_host/render_widget_host_view_aura.cc b/content/browser/renderer_host/render_widget_host_view_aura.cc |
index b4a1bc62abaf62b7195a822e272d31a2f9467576..dc8ff0a896314ed5f09cbc30e701c112d7de7d9a 100644 |
--- a/content/browser/renderer_host/render_widget_host_view_aura.cc |
+++ b/content/browser/renderer_host/render_widget_host_view_aura.cc |
@@ -322,18 +322,20 @@ void RenderWidgetHostViewAura::InitAsPopup( |
window_->Init(ui::LAYER_TEXTURED); |
window_->SetName("RenderWidgetHostViewAura"); |
- aura::Window* parent = NULL; |
aura::RootWindow* root = popup_parent_host_view_->window_->GetRootWindow(); |
+ |
+ // TODO(erg): While I could make sure details of the StackingClient are |
+ // hidden behind aura, hiding the details of the ScreenPositionClient will |
+ // take another effort. |
+ gfx::Point origin_in_screen(bounds_in_display.origin()); |
oshima
2012/11/26 21:24:46
bounds_in_display is in screen coordinates, so you
|
aura::client::ScreenPositionClient* screen_position_client = |
aura::client::GetScreenPositionClient(root); |
- if (screen_position_client) { |
- gfx::Point origin_in_screen(bounds_in_display.origin()); |
+ if (screen_position_client) |
screen_position_client->ConvertPointToScreen(root, &origin_in_screen); |
- parent = aura::client::GetStackingClient()->GetDefaultParent( |
- window_, window_, |
- gfx::Rect(origin_in_screen, bounds_in_display.size())); |
- } |
- window_->SetParent(parent); |
+ |
+ window_->SetDefaultParentByRoot( |
oshima
2012/11/26 21:24:46
Does this take screen coordinate? If so, SetDefaul
Elliot Glaysher
2012/11/26 23:02:30
Root in this case is referring to RootWindow, whic
oshima
2012/11/27 00:14:30
I see, my mistake.
|
+ root, |
+ gfx::Rect(origin_in_screen, bounds_in_display.size())); |
SetBounds(bounds_in_display); |
Show(); |
} |
@@ -345,7 +347,9 @@ void RenderWidgetHostViewAura::InitAsFullscreen( |
window_->Init(ui::LAYER_TEXTURED); |
window_->SetName("RenderWidgetHostViewAura"); |
window_->SetProperty(aura::client::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
- aura::Window* parent = NULL; |
+ |
+ aura::RootWindow* parent = NULL; |
+ gfx::Rect bounds; |
if (reference_host_view) { |
aura::Window* reference_window = |
static_cast<RenderWidgetHostViewAura*>(reference_host_view)->window_; |
@@ -355,13 +359,11 @@ void RenderWidgetHostViewAura::InitAsFullscreen( |
} |
gfx::Display display = gfx::Screen::GetScreenFor(window_)-> |
GetDisplayNearestWindow(reference_window); |
- aura::client::StackingClient* stacking_client = |
- aura::client::GetStackingClient(); |
- if (stacking_client) |
- parent = stacking_client->GetDefaultParent( |
- window_, window_, display.bounds()); |
+ parent = reference_window->GetRootWindow(); |
+ bounds = display.bounds(); |
} |
- window_->SetParent(parent); |
+ window_->SetDefaultParentByRoot(parent, bounds); |
+ |
Show(); |
Focus(); |
} |