| 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 "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h" | 5 #include "chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h" |
| 6 | 6 |
| 7 #include "chrome/browser/ui/views/frame/browser_frame.h" | 7 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 8 #include "chrome/browser/ui/views/frame/browser_view.h" | 8 #include "chrome/browser/ui/views/frame/browser_view.h" |
| 9 #include "grit/generated_resources.h" // Accessibility names | 9 #include "grit/generated_resources.h" // Accessibility names |
| 10 #include "grit/ui_resources.h" | 10 #include "grit/ui_resources.h" |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 239 *rb.GetBitmapNamed(IDR_AURA_WINDOW_CLOSE_ICON)); | 239 *rb.GetBitmapNamed(IDR_AURA_WINDOW_CLOSE_ICON)); |
| 240 close_button_->SetAccessibleName( | 240 close_button_->SetAccessibleName( |
| 241 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); | 241 l10n_util::GetStringUTF16(IDS_ACCNAME_CLOSE)); |
| 242 AddChildView(close_button_); | 242 AddChildView(close_button_); |
| 243 | 243 |
| 244 // The BrowserFrame will become our owning window/widget. | 244 // The BrowserFrame will become our owning window/widget. |
| 245 frame->AsWidget()->AddObserver(this); | 245 frame->AsWidget()->AddObserver(this); |
| 246 // Associate our WindowFrame interface with our owning window/widget so | 246 // Associate our WindowFrame interface with our owning window/widget so |
| 247 // we get callbacks from aura_shell. | 247 // we get callbacks from aura_shell. |
| 248 frame->AsWidget()->SetNativeWindowProperty( | 248 frame->AsWidget()->SetNativeWindowProperty( |
| 249 aura_shell::kWindowFrameKey, | 249 ash::kWindowFrameKey, |
| 250 static_cast<aura_shell::WindowFrame*>(this)); | 250 static_cast<ash::WindowFrame*>(this)); |
| 251 } | 251 } |
| 252 | 252 |
| 253 BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() { | 253 BrowserNonClientFrameViewAura::~BrowserNonClientFrameViewAura() { |
| 254 // Don't need to remove the Widget observer, the window is deleted before us. | 254 // Don't need to remove the Widget observer, the window is deleted before us. |
| 255 } | 255 } |
| 256 | 256 |
| 257 void BrowserNonClientFrameViewAura::ShowFrameBackground() { | 257 void BrowserNonClientFrameViewAura::ShowFrameBackground() { |
| 258 UpdateFrameBackground(ShouldPaintAsActive()); | 258 UpdateFrameBackground(ShouldPaintAsActive()); |
| 259 frame_background_->Show(); | 259 frame_background_->Show(); |
| 260 } | 260 } |
| (...skipping 301 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 562 /////////////////////////////////////////////////////////////////////////////// | 562 /////////////////////////////////////////////////////////////////////////////// |
| 563 // views::Widget::Observer overrides: | 563 // views::Widget::Observer overrides: |
| 564 | 564 |
| 565 void BrowserNonClientFrameViewAura::OnWidgetActivationChanged( | 565 void BrowserNonClientFrameViewAura::OnWidgetActivationChanged( |
| 566 views::Widget* widget, | 566 views::Widget* widget, |
| 567 bool active) { | 567 bool active) { |
| 568 ActiveStateChanged(); | 568 ActiveStateChanged(); |
| 569 } | 569 } |
| 570 | 570 |
| 571 /////////////////////////////////////////////////////////////////////////////// | 571 /////////////////////////////////////////////////////////////////////////////// |
| 572 // aura_shell::WindowFrame overrides: | 572 // ash::WindowFrame overrides: |
| 573 | 573 |
| 574 void BrowserNonClientFrameViewAura::OnWindowHoverChanged(bool hovered) { | 574 void BrowserNonClientFrameViewAura::OnWindowHoverChanged(bool hovered) { |
| 575 if (hovered) { | 575 if (hovered) { |
| 576 maximize_button_->Show(); | 576 maximize_button_->Show(); |
| 577 close_button_->Show(); | 577 close_button_->Show(); |
| 578 } else { | 578 } else { |
| 579 maximize_button_->Hide(); | 579 maximize_button_->Hide(); |
| 580 close_button_->Hide(); | 580 close_button_->Hide(); |
| 581 } | 581 } |
| 582 } | 582 } |
| OLD | NEW |