Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: ash/frame/caption_buttons/frame_caption_button_container_view.cc

Issue 2113053003: Moves Shell::maximize_mode_controller() to WmShell (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: order Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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/frame/caption_buttons/frame_caption_button_container_view.h" 5 #include "ash/frame/caption_buttons/frame_caption_button_container_view.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 #include <map> 8 #include <map>
9 9
10 #include "ash/common/ash_switches.h" 10 #include "ash/common/ash_switches.h"
(...skipping 290 matching lines...) Expand 10 before | Expand all | Expand 10 after
301 301
302 FrameCaptionButton::Animate fcb_animate = 302 FrameCaptionButton::Animate fcb_animate =
303 (animate == ANIMATE_YES) ? FrameCaptionButton::ANIMATE_YES 303 (animate == ANIMATE_YES) ? FrameCaptionButton::ANIMATE_YES
304 : FrameCaptionButton::ANIMATE_NO; 304 : FrameCaptionButton::ANIMATE_NO;
305 auto it = button_icon_id_map_.find(icon); 305 auto it = button_icon_id_map_.find(icon);
306 if (it != button_icon_id_map_.end()) 306 if (it != button_icon_id_map_.end())
307 button->SetImage(icon, fcb_animate, it->second); 307 button->SetImage(icon, fcb_animate, it->second);
308 } 308 }
309 309
310 bool FrameCaptionButtonContainerView::ShouldSizeButtonBeVisible() const { 310 bool FrameCaptionButtonContainerView::ShouldSizeButtonBeVisible() const {
311 return !Shell::GetInstance() 311 return !WmShell::Get()
312 ->maximize_mode_controller() 312 ->maximize_mode_controller()
313 ->IsMaximizeModeWindowManagerEnabled() && 313 ->IsMaximizeModeWindowManagerEnabled() &&
314 frame_->widget_delegate()->CanMaximize(); 314 frame_->widget_delegate()->CanMaximize();
315 } 315 }
316 316
317 void FrameCaptionButtonContainerView::ButtonPressed(views::Button* sender, 317 void FrameCaptionButtonContainerView::ButtonPressed(views::Button* sender,
318 const ui::Event& event) { 318 const ui::Event& event) {
319 // Abort any animations of the button icons. 319 // Abort any animations of the button icons.
320 SetButtonsToNormal(ANIMATE_NO); 320 SetButtonsToNormal(ANIMATE_NO);
321 321
(...skipping 85 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 views::Button::ButtonState new_state = views::Button::STATE_NORMAL; 407 views::Button::ButtonState new_state = views::Button::STATE_NORMAL;
408 if (button == to_hover) 408 if (button == to_hover)
409 new_state = views::Button::STATE_HOVERED; 409 new_state = views::Button::STATE_HOVERED;
410 else if (button == to_press) 410 else if (button == to_press)
411 new_state = views::Button::STATE_PRESSED; 411 new_state = views::Button::STATE_PRESSED;
412 button->SetState(new_state); 412 button->SetState(new_state);
413 } 413 }
414 } 414 }
415 415
416 } // namespace ash 416 } // namespace ash
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698