| 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/generated_resources.h" // Accessibility names | 10 #include "grit/generated_resources.h" // Accessibility names |
| (...skipping 229 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 240 | 240 |
| 241 void AppNonClientFrameViewAura::UpdateThrobber(bool running) { | 241 void AppNonClientFrameViewAura::UpdateThrobber(bool running) { |
| 242 } | 242 } |
| 243 | 243 |
| 244 void AppNonClientFrameViewAura::OnMouseEntered( | 244 void AppNonClientFrameViewAura::OnMouseEntered( |
| 245 const views::MouseEvent& event) { | 245 const views::MouseEvent& event) { |
| 246 if (!control_widget_) { | 246 if (!control_widget_) { |
| 247 control_widget_ = new views::Widget; | 247 control_widget_ = new views::Widget; |
| 248 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); | 248 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); |
| 249 control_widget_->AddObserver(this); | 249 control_widget_->AddObserver(this); |
| 250 params.parent = browser_view()->GetNativeHandle(); | 250 params.parent = browser_view()->GetNativeWindow(); |
| 251 params.transparent = true; | 251 params.transparent = true; |
| 252 control_widget_->Init(params); | 252 control_widget_->Init(params); |
| 253 control_widget_->SetContentsView(control_view_); | 253 control_widget_->SetContentsView(control_view_); |
| 254 aura::Window* window = control_widget_->GetNativeView(); | 254 aura::Window* window = control_widget_->GetNativeView(); |
| 255 window->SetName("AppNonClientFrameViewAuraControls"); | 255 window->SetName("AppNonClientFrameViewAuraControls"); |
| 256 gfx::Rect control_bounds = GetControlBounds(); | 256 gfx::Rect control_bounds = GetControlBounds(); |
| 257 if (animate_controls_) | 257 if (animate_controls_) |
| 258 control_bounds.set_y(control_bounds.y() - control_bounds.height()); | 258 control_bounds.set_y(control_bounds.y() - control_bounds.height()); |
| 259 window->SetBounds(control_bounds); | 259 window->SetBounds(control_bounds); |
| 260 control_widget_->Show(); | 260 control_widget_->Show(); |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 312 bool AppNonClientFrameViewAura::IsShowingControls() const { | 312 bool AppNonClientFrameViewAura::IsShowingControls() const { |
| 313 return control_widget_ && control_widget_->IsVisible(); | 313 return control_widget_ && control_widget_->IsVisible(); |
| 314 } | 314 } |
| 315 | 315 |
| 316 void AppNonClientFrameViewAura::Restore() { | 316 void AppNonClientFrameViewAura::Restore() { |
| 317 if (control_widget_) | 317 if (control_widget_) |
| 318 control_widget_->Close(); | 318 control_widget_->Close(); |
| 319 mouse_watcher_.Stop(); | 319 mouse_watcher_.Stop(); |
| 320 frame()->Restore(); | 320 frame()->Restore(); |
| 321 } | 321 } |
| OLD | NEW |