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 110 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
121 void RenderWidgetHostViewAura::InitAsPopup( | 121 void RenderWidgetHostViewAura::InitAsPopup( |
122 RenderWidgetHostView* parent_host_view, | 122 RenderWidgetHostView* parent_host_view, |
123 const gfx::Rect& pos) { | 123 const gfx::Rect& pos) { |
124 popup_parent_host_view_ = | 124 popup_parent_host_view_ = |
125 static_cast<RenderWidgetHostViewAura*>(parent_host_view); | 125 static_cast<RenderWidgetHostViewAura*>(parent_host_view); |
126 window_->SetType(aura::WINDOW_TYPE_MENU); | 126 window_->SetType(aura::WINDOW_TYPE_MENU); |
127 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); | 127 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); |
128 | 128 |
129 window_->SetParent(NULL); | 129 window_->SetParent(NULL); |
130 Show(); | 130 Show(); |
131 SetBounds(pos); | 131 |
132 // |pos| is in desktop coordinate. So convert it to | |
Ben Goodger (Google)
2011/11/14 23:36:17
coordinates
sadrul
2011/11/14 23:42:51
Done.
| |
133 // |popup_parent_host_view_|'s coordinate first. | |
Ben Goodger (Google)
2011/11/14 23:36:17
coordinates
sadrul
2011/11/14 23:42:51
Done.
| |
134 gfx::Point origin = pos.origin(); | |
135 aura::Window::ConvertPointToWindow( | |
136 static_cast<aura::Window*>(aura::Desktop::GetInstance()), | |
Ben Goodger (Google)
2011/11/14 23:36:17
cast isn't necessary?
sadrul
2011/11/14 23:42:51
Indeed. Removed.
| |
137 popup_parent_host_view_->window_, &origin); | |
138 SetBounds(gfx::Rect(origin, pos.size())); | |
132 } | 139 } |
133 | 140 |
134 void RenderWidgetHostViewAura::InitAsFullscreen( | 141 void RenderWidgetHostViewAura::InitAsFullscreen( |
135 RenderWidgetHostView* reference_host_view) { | 142 RenderWidgetHostView* reference_host_view) { |
136 is_fullscreen_ = true; | 143 is_fullscreen_ = true; |
137 window_->SetType(aura::WINDOW_TYPE_NORMAL); | 144 window_->SetType(aura::WINDOW_TYPE_NORMAL); |
138 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); | 145 window_->Init(ui::Layer::LAYER_HAS_TEXTURE); |
139 window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); | 146 window_->SetIntProperty(aura::kShowStateKey, ui::SHOW_STATE_FULLSCREEN); |
140 window_->SetParent(NULL); | 147 window_->SetParent(NULL); |
141 Show(); | 148 Show(); |
(...skipping 392 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
534 // static | 541 // static |
535 void RenderWidgetHostView::GetDefaultScreenInfo( | 542 void RenderWidgetHostView::GetDefaultScreenInfo( |
536 WebKit::WebScreenInfo* results) { | 543 WebKit::WebScreenInfo* results) { |
537 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); | 544 const gfx::Size size = gfx::Screen::GetPrimaryMonitorSize(); |
538 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); | 545 results->rect = WebKit::WebRect(0, 0, size.width(), size.height()); |
539 results->availableRect = results->rect; | 546 results->availableRect = results->rect; |
540 // TODO(derat): Don't hardcode this? | 547 // TODO(derat): Don't hardcode this? |
541 results->depth = 24; | 548 results->depth = 24; |
542 results->depthPerComponent = 8; | 549 results->depthPerComponent = 8; |
543 } | 550 } |
OLD | NEW |