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 76 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
87 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE { | 87 virtual void OnMouseEntered(const views::MouseEvent& event) OVERRIDE { |
88 // Ensure the caption/frame background shows when we hover this button. | 88 // Ensure the caption/frame background shows when we hover this button. |
89 owner_->ShowFrameBackground(); | 89 owner_->ShowFrameBackground(); |
90 views::CustomButton::OnMouseEntered(event); | 90 views::CustomButton::OnMouseEntered(event); |
91 } | 91 } |
92 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE { | 92 virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE { |
93 owner_->HideFrameBackground(); | 93 owner_->HideFrameBackground(); |
94 views::CustomButton::OnMouseExited(event); | 94 views::CustomButton::OnMouseExited(event); |
95 } | 95 } |
96 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 96 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
97 canvas->FillRect(GetBackgroundColor(), GetLocalBounds()); | 97 canvas->FillRect(GetLocalBounds(), GetBackgroundColor()); |
98 canvas->DrawBitmapInt(icon_, 0, 0); | 98 canvas->DrawBitmapInt(icon_, 0, 0); |
99 } | 99 } |
100 virtual gfx::Size GetPreferredSize() OVERRIDE { | 100 virtual gfx::Size GetPreferredSize() OVERRIDE { |
101 return gfx::Size(icon_.width(), icon_.height()); | 101 return gfx::Size(icon_.width(), icon_.height()); |
102 } | 102 } |
103 | 103 |
104 // Overridden from ui::AnimationDelegate: | 104 // Overridden from ui::AnimationDelegate: |
105 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { | 105 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE { |
106 if (animation == show_animation_.get()) { | 106 if (animation == show_animation_.get()) { |
107 double opacity = show_animation_->GetCurrentValue(); | 107 double opacity = show_animation_->GetCurrentValue(); |
(...skipping 465 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 |