15d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 25d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 35d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// found in the LICENSE file. 45d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 55d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#ifndef UI_APP_LIST_VIEWS_FOLDER_BACKGROUND_VIEW_H_ 65d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#define UI_APP_LIST_VIEWS_FOLDER_BACKGROUND_VIEW_H_ 75d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 85d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/compositor/layer_animation_observer.h" 95d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#include "ui/views/view.h" 105d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 115d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)namespace app_list { 125d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 135d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class AppListFolderView; 145d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 155d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// Draws the ink bubble indicating the boundary of the folder when user drags an 165d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)// item inside a folder. 175d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)class FolderBackgroundView : public views::View, 185d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public ui::ImplicitAnimationObserver { 195d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) public: 205d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) enum ShowState { 215d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) NO_BUBBLE, 225d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) SHOW_BUBBLE, 235d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) HIDE_BUBBLE, 245d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) }; 255d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 265d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) FolderBackgroundView(); 275d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual ~FolderBackgroundView(); 285d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 295d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Updates the ink bubble's ShowState. 305d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) void UpdateFolderContainerBubble(ShowState state); 315d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 325d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // Returns the radius of the folder container ink bubble. 335d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) int GetFolderContainerBubbleRadius() const; 345d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 355d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) void set_folder_view(AppListFolderView* folder_view) { 365d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) folder_view_ = folder_view; 375d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) } 385d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 395d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) private: 405d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // views::View overrides: 415d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE; 425d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 435d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) // ui::ImplicitAnimationObserver overrides: 445d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) virtual void OnImplicitAnimationsCompleted() OVERRIDE; 455d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 465d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) AppListFolderView* folder_view_; 475d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) ShowState show_state_; 485d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 495d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) DISALLOW_COPY_AND_ASSIGN(FolderBackgroundView); 505d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)}; 515d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 525d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)} // namespace app_list 535d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles) 545d1f7b1de12d16ceb2c938c56701a3e8bfa558f7Torne (Richard Coles)#endif // UI_APP_LIST_VIEWS_FOLDER_BACKGROUND_VIEW_H_ 55