1a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Copyright 2014 The Chromium Authors. All rights reserved. 2a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Use of this source code is governed by a BSD-style license that can be 3a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// found in the LICENSE file. 4a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 5a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#ifndef ASH_FRAME_HEADER_PAINTER_UTIL_H_ 6a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#define ASH_FRAME_HEADER_PAINTER_UTIL_H_ 7a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 8a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "ash/ash_export.h" 9a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#include "base/macros.h" 10a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 11a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace gfx { 12a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class FontList; 13a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class Rect; 14a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 15a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace views { 16a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class View; 17a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class Widget; 18a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} 19a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 20a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)namespace ash { 21a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 22a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// Static-only helper class for functionality used accross multiple 23a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)// implementations of HeaderPainter. 24a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)class ASH_EXPORT HeaderPainterUtil { 25a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) public: 26a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Returns the radius of the header's corners when the window is restored. 27a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) static int GetTopCornerRadiusWhenRestored(); 28a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 2903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) // Returns the default distance between the left edge of the window and the 3003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) // leftmost view in the header. 3103b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) static int GetDefaultLeftViewXInset(); 32a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 33a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Returns the amount that the frame background is inset from the left edge of 34a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // the window. 35a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) static int GetThemeBackgroundXInset(); 36a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 3703b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) // Returns the bounds for the header's title given the views to the left and 3803b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) // right of the title, and the font used. 3903b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) // |left_view| should be NULL if there is no view to the left of the title. 4003b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) static gfx::Rect GetTitleBounds(const views::View* left_view, 4103b57e008b61dfcb1fbad3aea950ae0e001748b0Torne (Richard Coles) const views::View* right_view, 42a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) const gfx::FontList& title_font_list); 43a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 44a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // Returns true if the header for |widget| can animate to new visuals when the 45a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // widget's activation changes. Returns false if the header should switch to 46a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) // new visuals instantaneously. 47a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) static bool CanAnimateActivation(views::Widget* widget); 48a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 49a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) private: 50a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) DISALLOW_IMPLICIT_CONSTRUCTORS(HeaderPainterUtil); 51a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)}; 52a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 53a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)} // namespace ash 54a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles) 55a1401311d1ab56c4ed0a474bd38c108f75cb0cd9Torne (Richard Coles)#endif // ASH_FRAME_HEADER_PAINTER_UTIL_H_ 56