From ab0a50979b9eb4dfa3320eff7e187e41efedf7a9 Mon Sep 17 00:00:00 2001 From: Jocelyn Turcotte Date: Fri, 8 Aug 2014 14:30:41 +0200 Subject: Update Chromium to beta version 37.0.2062.68 Change-Id: I188e3b5aff1bec75566014291b654eb19f5bc8ca Reviewed-by: Andras Becsi --- .../caption_buttons/maximize_bubble_controller.cc | 99 ---------------------- 1 file changed, 99 deletions(-) delete mode 100644 chromium/ash/wm/caption_buttons/maximize_bubble_controller.cc (limited to 'chromium/ash/wm/caption_buttons/maximize_bubble_controller.cc') diff --git a/chromium/ash/wm/caption_buttons/maximize_bubble_controller.cc b/chromium/ash/wm/caption_buttons/maximize_bubble_controller.cc deleted file mode 100644 index f01d0e22783..00000000000 --- a/chromium/ash/wm/caption_buttons/maximize_bubble_controller.cc +++ /dev/null @@ -1,99 +0,0 @@ -// Copyright 2013 The Chromium Authors. All rights reserved. -// Use of this source code is governed by a BSD-style license that can be -// found in the LICENSE file. - -#include "ash/wm/caption_buttons/maximize_bubble_controller.h" - -#include "ash/wm/caption_buttons/frame_maximize_button.h" -#include "ash/wm/caption_buttons/maximize_bubble_controller_bubble.h" -#include "base/timer/timer.h" - - -namespace ash { - -MaximizeBubbleController::MaximizeBubbleController( - FrameMaximizeButton* frame_maximize_button, - MaximizeBubbleFrameState maximize_type, - int appearance_delay_ms) - : frame_maximize_button_(frame_maximize_button), - bubble_(NULL), - maximize_type_(maximize_type), - snap_type_for_creation_(SNAP_NONE), - appearance_delay_ms_(appearance_delay_ms) { - // Create the task which will create the bubble delayed. - base::OneShotTimer* new_timer = - new base::OneShotTimer(); - // Note: Even if there was no delay time given, we need to have a timer. - new_timer->Start( - FROM_HERE, - base::TimeDelta::FromMilliseconds( - appearance_delay_ms_ ? appearance_delay_ms_ : 10), - this, - &MaximizeBubbleController::CreateBubble); - timer_.reset(new_timer); - if (!appearance_delay_ms_) - CreateBubble(); -} - -MaximizeBubbleController::~MaximizeBubbleController() { - // Note: The destructor only gets initiated through the owner. - timer_.reset(); - if (bubble_) { - bubble_->ControllerRequestsCloseAndDelete(); - bubble_ = NULL; - } -} - -void MaximizeBubbleController::SetSnapType(SnapType snap_type) { - if (bubble_) { - bubble_->SetSnapType(snap_type); - } else { - // The bubble has not been created yet. This can occur if bubble creation is - // delayed. - snap_type_for_creation_ = snap_type; - } -} - -aura::Window* MaximizeBubbleController::GetBubbleWindow() { - return bubble_ ? bubble_->GetBubbleWindow() : NULL; -} - -void MaximizeBubbleController::DelayCreation() { - if (timer_.get() && timer_->IsRunning()) - timer_->Reset(); -} - -void MaximizeBubbleController::OnButtonClicked(SnapType snap_type) { - frame_maximize_button_->ExecuteSnapAndCloseMenu(snap_type); -} - -void MaximizeBubbleController::OnButtonHover(SnapType snap_type) { - frame_maximize_button_->SnapButtonHovered(snap_type); -} - -views::CustomButton* MaximizeBubbleController::GetButtonForUnitTest( - SnapType state) { - return bubble_ ? bubble_->GetButtonForUnitTest(state) : NULL; -} - -void MaximizeBubbleController::RequestDestructionThroughOwner() { - // Tell the parent to destroy us (if this didn't happen yet). - if (timer_) { - timer_.reset(NULL); - // Informs the owner that the menu is gone and requests |this| destruction. - frame_maximize_button_->DestroyMaximizeMenu(); - // Note: After this call |this| is destroyed. - } -} - -void MaximizeBubbleController::CreateBubble() { - if (!bubble_) { - bubble_ = new MaximizeBubbleControllerBubble(this, appearance_delay_ms_, - snap_type_for_creation_); - frame_maximize_button_->OnMaximizeBubbleShown(bubble_->GetWidget()); - } - - timer_->Stop(); -} - -} // namespace ash -- cgit v1.2.3