| OLD | NEW |
| 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 Loading... |
| 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); | |
| 254 ConvertPointToWidget(this, &location); | |
| 255 return gfx::Rect( | 253 return gfx::Rect( |
| 256 location.x(), location.y(), | 254 width() - preferred.width(), 0, |
| 257 preferred.width(), preferred.height()); | 255 preferred.width(), preferred.height()); |
| 258 } | 256 } |
| 259 | 257 |
| 260 void AppNonClientFrameViewAura::CloseControlWidget() { | 258 void AppNonClientFrameViewAura::CloseControlWidget() { |
| 261 if (control_widget_) { | 259 if (control_widget_) { |
| 262 control_widget_->Close(); | 260 control_widget_->Close(); |
| 263 control_widget_ = NULL; | 261 control_widget_ = NULL; |
| 264 } | 262 } |
| 265 } | 263 } |
| OLD | NEW |