| 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" |
| 11 #include "ash/wm/caption_buttons/frame_maximize_button.h" | 11 #include "ash/wm/caption_buttons/frame_maximize_button.h" |
| 12 #include "ash/wm/window_settings.h" | 12 #include "ash/wm/window_state.h" |
| 13 #include "grit/ash_resources.h" | 13 #include "grit/ash_resources.h" |
| 14 #include "grit/ui_strings.h" // Accessibility names | 14 #include "grit/ui_strings.h" // Accessibility names |
| 15 #include "ui/base/hit_test.h" | 15 #include "ui/base/hit_test.h" |
| 16 #include "ui/base/l10n/l10n_util.h" | 16 #include "ui/base/l10n/l10n_util.h" |
| 17 #include "ui/base/resource/resource_bundle.h" | 17 #include "ui/base/resource/resource_bundle.h" |
| 18 #include "ui/compositor/scoped_animation_duration_scale_mode.h" | 18 #include "ui/compositor/scoped_animation_duration_scale_mode.h" |
| 19 #include "ui/gfx/canvas.h" | 19 #include "ui/gfx/canvas.h" |
| 20 #include "ui/views/border.h" | 20 #include "ui/views/border.h" |
| 21 #include "ui/views/controls/button/image_button.h" | 21 #include "ui/views/controls/button/image_button.h" |
| 22 #include "ui/views/widget/widget.h" | 22 #include "ui/views/widget/widget.h" |
| (...skipping 160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 183 IDR_AURA_WINDOW_FULLSCREEN_RESTORE_H, | 183 IDR_AURA_WINDOW_FULLSCREEN_RESTORE_H, |
| 184 IDR_AURA_WINDOW_FULLSCREEN_RESTORE_P); | 184 IDR_AURA_WINDOW_FULLSCREEN_RESTORE_P); |
| 185 SetButtonImages(close_button_, | 185 SetButtonImages(close_button_, |
| 186 IDR_AURA_WINDOW_FULLSCREEN_CLOSE, | 186 IDR_AURA_WINDOW_FULLSCREEN_CLOSE, |
| 187 IDR_AURA_WINDOW_FULLSCREEN_CLOSE_H, | 187 IDR_AURA_WINDOW_FULLSCREEN_CLOSE_H, |
| 188 IDR_AURA_WINDOW_FULLSCREEN_CLOSE_P); | 188 IDR_AURA_WINDOW_FULLSCREEN_CLOSE_P); |
| 189 } else if (header_style_ == HEADER_STYLE_SHORT) { | 189 } else if (header_style_ == HEADER_STYLE_SHORT) { |
| 190 // The new assets only make sense if the window is maximized or fullscreen | 190 // The new assets only make sense if the window is maximized or fullscreen |
| 191 // because we usually use a black header in this case. | 191 // because we usually use a black header in this case. |
| 192 if ((frame_->IsMaximized() || frame_->IsFullscreen()) && | 192 if ((frame_->IsMaximized() || frame_->IsFullscreen()) && |
| 193 wm::GetWindowSettings( | 193 wm::GetWindowState( |
| 194 frame_->GetNativeWindow())->tracked_by_workspace()) { | 194 frame_->GetNativeWindow())->tracked_by_workspace()) { |
| 195 SetButtonImages(size_button_, | 195 SetButtonImages(size_button_, |
| 196 IDR_AURA_WINDOW_MAXIMIZED_RESTORE2, | 196 IDR_AURA_WINDOW_MAXIMIZED_RESTORE2, |
| 197 IDR_AURA_WINDOW_MAXIMIZED_RESTORE2_H, | 197 IDR_AURA_WINDOW_MAXIMIZED_RESTORE2_H, |
| 198 IDR_AURA_WINDOW_MAXIMIZED_RESTORE2_P); | 198 IDR_AURA_WINDOW_MAXIMIZED_RESTORE2_P); |
| 199 SetButtonImages(close_button_, | 199 SetButtonImages(close_button_, |
| 200 IDR_AURA_WINDOW_MAXIMIZED_CLOSE2, | 200 IDR_AURA_WINDOW_MAXIMIZED_CLOSE2, |
| 201 IDR_AURA_WINDOW_MAXIMIZED_CLOSE2_H, | 201 IDR_AURA_WINDOW_MAXIMIZED_CLOSE2_H, |
| 202 IDR_AURA_WINDOW_MAXIMIZED_CLOSE2_P); | 202 IDR_AURA_WINDOW_MAXIMIZED_CLOSE2_P); |
| 203 } else { | 203 } else { |
| (...skipping 143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 347 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); | 347 ui::ResourceBundle& resource_bundle = ui::ResourceBundle::GetSharedInstance(); |
| 348 image_button->SetImage(views::CustomButton::STATE_NORMAL, | 348 image_button->SetImage(views::CustomButton::STATE_NORMAL, |
| 349 resource_bundle.GetImageSkiaNamed(normal_image_id)); | 349 resource_bundle.GetImageSkiaNamed(normal_image_id)); |
| 350 image_button->SetImage(views::CustomButton::STATE_HOVERED, | 350 image_button->SetImage(views::CustomButton::STATE_HOVERED, |
| 351 resource_bundle.GetImageSkiaNamed(hot_image_id)); | 351 resource_bundle.GetImageSkiaNamed(hot_image_id)); |
| 352 image_button->SetImage(views::CustomButton::STATE_PRESSED, | 352 image_button->SetImage(views::CustomButton::STATE_PRESSED, |
| 353 resource_bundle.GetImageSkiaNamed(pushed_image_id)); | 353 resource_bundle.GetImageSkiaNamed(pushed_image_id)); |
| 354 } | 354 } |
| 355 | 355 |
| 356 } // namespace ash | 356 } // namespace ash |
| OLD | NEW |