| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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 "ash/wm/caption_buttons/frame_caption_button_container_view.h" | 5 #include "ash/wm/caption_buttons/frame_caption_button_container_view.h" |
| 6 | 6 |
| 7 #include "ash/ash_switches.h" | 7 #include "ash/ash_switches.h" |
| 8 #include "ash/shell.h" | 8 #include "ash/shell.h" |
| 9 #include "ash/shell_delegate.h" | 9 #include "ash/shell_delegate.h" |
| 10 #include "ash/wm/caption_buttons/alternate_frame_caption_button.h" | 10 #include "ash/wm/caption_buttons/alternate_frame_caption_button.h" |
| (...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 107 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); | 107 l10n_util::GetStringUTF16(IDS_APP_ACCNAME_CLOSE)); |
| 108 AddChildView(close_button_); | 108 AddChildView(close_button_); |
| 109 | 109 |
| 110 button_separator_ = ui::ResourceBundle::GetSharedInstance().GetImageNamed( | 110 button_separator_ = ui::ResourceBundle::GetSharedInstance().GetImageNamed( |
| 111 IDR_AURA_WINDOW_BUTTON_SEPARATOR).AsImageSkia(); | 111 IDR_AURA_WINDOW_BUTTON_SEPARATOR).AsImageSkia(); |
| 112 } | 112 } |
| 113 | 113 |
| 114 FrameCaptionButtonContainerView::~FrameCaptionButtonContainerView() { | 114 FrameCaptionButtonContainerView::~FrameCaptionButtonContainerView() { |
| 115 } | 115 } |
| 116 | 116 |
| 117 FrameMaximizeButton* |
| 118 FrameCaptionButtonContainerView::GetOldStyleSizeButton() { |
| 119 return switches::UseAlternateFrameCaptionButtonStyle() ? |
| 120 NULL : static_cast<FrameMaximizeButton*>(size_button_); |
| 121 } |
| 122 |
| 117 void FrameCaptionButtonContainerView::ResetWindowControls() { | 123 void FrameCaptionButtonContainerView::ResetWindowControls() { |
| 118 minimize_button_->SetState(views::CustomButton::STATE_NORMAL); | 124 minimize_button_->SetState(views::CustomButton::STATE_NORMAL); |
| 119 size_button_->SetState(views::CustomButton::STATE_NORMAL); | 125 size_button_->SetState(views::CustomButton::STATE_NORMAL); |
| 120 } | 126 } |
| 121 | 127 |
| 122 int FrameCaptionButtonContainerView::NonClientHitTest( | 128 int FrameCaptionButtonContainerView::NonClientHitTest( |
| 123 const gfx::Point& point) const { | 129 const gfx::Point& point) const { |
| 124 if (close_button_->visible() && | 130 if (close_button_->visible() && |
| 125 ConvertPointToViewAndHitTest(this, close_button_, point)) { | 131 ConvertPointToViewAndHitTest(this, close_button_, point)) { |
| 126 return HTCLOSE; | 132 return HTCLOSE; |
| (...skipping 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 346 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 352 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
| 347 image_button->SetImage(views::CustomButton::STATE_NORMAL, | 353 image_button->SetImage(views::CustomButton::STATE_NORMAL, |
| 348 resource_bundle.GetImageSkiaNamed(normal_image_id)); | 354 resource_bundle.GetImageSkiaNamed(normal_image_id)); |
| 349 image_button->SetImage(views::CustomButton::STATE_HOVERED, | 355 image_button->SetImage(views::CustomButton::STATE_HOVERED, |
| 350 resource_bundle.GetImageSkiaNamed(hot_image_id)); | 356 resource_bundle.GetImageSkiaNamed(hot_image_id)); |
| 351 image_button->SetImage(views::CustomButton::STATE_PRESSED, | 357 image_button->SetImage(views::CustomButton::STATE_PRESSED, |
| 352 resource_bundle.GetImageSkiaNamed(pushed_image_id)); | 358 resource_bundle.GetImageSkiaNamed(pushed_image_id)); |
| 353 } | 359 } |
| 354 | 360 |
| 355 } // namespace ash | 361 } // namespace ash |
| OLD | NEW |