Home | History | Annotate | Download | only in views
      1 // Copyright (c) 2011 The Chromium Authors. All rights reserved.
      2 // Use of this source code is governed by a BSD-style license that can be
      3 // found in the LICENSE file.
      4 
      5 #ifndef CHROME_BROWSER_UI_VIEWS_PROFILE_TAG_VIEW_H_
      6 #define CHROME_BROWSER_UI_VIEWS_PROFILE_TAG_VIEW_H_
      7 #pragma once
      8 
      9 #include "third_party/skia/include/core/SkBitmap.h"
     10 #include "views/view.h"
     11 
     12 class BrowserFrame;
     13 
     14 namespace gfx {
     15 class Canvas;
     16 }
     17 
     18 namespace views {
     19 
     20 class ProfileMenuButton;
     21 
     22 // ProfileTag
     23 //
     24 // Displays the tinted button image underneath the ProfileMenuButton.
     25 
     26 class ProfileTagView : public View {
     27  public:
     28   // Height of profile tag.
     29   static const int kProfileTagHeight = 20;
     30 
     31   ProfileTagView(BrowserFrame* frame,
     32                  views::ProfileMenuButton* profile_menu_button);
     33   ~ProfileTagView() {}
     34 
     35   // Paint the profile tag background image on the given canvas.
     36   virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
     37 
     38  private:
     39   // Create the bitmaps to be displayed on the frame behind the profile button.
     40   void CreateProfileTagBitmaps();
     41 
     42   // True if the bitmaps to display the profile tag have been created.
     43   bool profile_tag_bitmaps_created_;
     44 
     45   // Bitmaps for the profile tag in active and inactive states.
     46   SkBitmap active_profile_tag_center_;
     47   SkBitmap active_profile_tag_left_;
     48   SkBitmap active_profile_tag_right_;
     49   SkBitmap inactive_profile_tag_center_;
     50   SkBitmap inactive_profile_tag_left_;
     51   SkBitmap inactive_profile_tag_right_;
     52 
     53   // The frame that hosts this view.
     54   BrowserFrame* frame_;
     55 
     56   // The button to be displayed above this view.
     57   views::ProfileMenuButton* profile_menu_button_;
     58 
     59   DISALLOW_COPY_AND_ASSIGN(ProfileTagView);
     60 };
     61 
     62 }  // namespace views
     63 
     64 #endif  // CHROME_BROWSER_UI_VIEWS_PROFILE_TAG_VIEW_H_
     65 
     66