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

Side by Side Diff: chrome/browser/ui/views/frame/app_non_client_frame_view_aura.cc

Issue 10986003: Fixed problem with disappearing window controls for applications when maximizing / minimizing / max… (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 3 months 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 | chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc » ('j') | 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) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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 "chrome/browser/ui/views/frame/app_non_client_frame_view_aura.h" 5 #include "chrome/browser/ui/views/frame/app_non_client_frame_view_aura.h"
6 6
7 #include "base/debug/stack_trace.h" 7 #include "base/debug/stack_trace.h"
8 #include "chrome/browser/ui/views/frame/browser_frame.h" 8 #include "chrome/browser/ui/views/frame/browser_frame.h"
9 #include "chrome/browser/ui/views/frame/browser_view.h" 9 #include "chrome/browser/ui/views/frame/browser_view.h"
10 #include "grit/ash_resources.h" 10 #include "grit/ash_resources.h"
(...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 void AppNonClientFrameViewAura::OnBoundsChanged( 243 void AppNonClientFrameViewAura::OnBoundsChanged(
244 const gfx::Rect& previous_bounds) { 244 const gfx::Rect& previous_bounds) {
245 if (control_widget_) 245 if (control_widget_)
246 control_widget_->GetNativeView()->SetBounds(GetControlBounds()); 246 control_widget_->GetNativeView()->SetBounds(GetControlBounds());
247 } 247 }
248 248
249 gfx::Rect AppNonClientFrameViewAura::GetControlBounds() const { 249 gfx::Rect AppNonClientFrameViewAura::GetControlBounds() const {
250 if (!control_view_) 250 if (!control_view_)
251 return gfx::Rect(); 251 return gfx::Rect();
252 gfx::Size preferred = control_view_->GetPreferredSize(); 252 gfx::Size preferred = control_view_->GetPreferredSize();
253 gfx::Point location(width() - preferred.width(), 0); 253 const gfx::Rect bounds =
254 ConvertPointToWidget(this, &location); 254 control_widget_->GetTopLevelWidgetForNativeView(
255 control_widget_->GetNativeWindow())->GetWindowBoundsInScreen();
256 // Position it flush to the right side of the (parent) widget.
257 gfx::Point location(bounds.width() - preferred.width(), 0);
sky 2012/09/24 21:24:16 control_widget_ is a child widget of the browser.
Mr4D (OOO till 08-26) 2012/09/25 14:23:50 Well - in the case I have seen (and I can reproduc
255 return gfx::Rect( 258 return gfx::Rect(
256 location.x(), location.y(), 259 location.x(), location.y(),
257 preferred.width(), preferred.height()); 260 preferred.width(), preferred.height());
258 } 261 }
259 262
260 void AppNonClientFrameViewAura::CloseControlWidget() { 263 void AppNonClientFrameViewAura::CloseControlWidget() {
261 if (control_widget_) { 264 if (control_widget_) {
262 control_widget_->Close(); 265 control_widget_->Close();
263 control_widget_ = NULL; 266 control_widget_ = NULL;
264 } 267 }
265 } 268 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/app_non_client_frame_view_aura_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698