Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(324)

Side by Side Diff: content/browser/renderer_host/render_widget_host_view_aura.cc

Issue 8555020: aura: Fix popup window positioning. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 coordinates. So convert it to
133 // |popup_parent_host_view_|'s coordinates first.
134 gfx::Point origin = pos.origin();
135 aura::Window::ConvertPointToWindow(
136 aura::Desktop::GetInstance(),
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
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 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698