| Index: chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h
|
| diff --git a/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h b/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h
|
| index 4655c41d8930b30abace75339d098c71e6f40c14..21ef45b3310100f3001857aeb7a63e672672dfca 100644
|
| --- a/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h
|
| +++ b/chrome/browser/ui/views/frame/browser_non_client_frame_view_aura.h
|
| @@ -6,43 +6,24 @@
|
| #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_AURA_H_
|
| #pragma once
|
|
|
| -#include "ash/wm/window_frame.h"
|
| #include "base/memory/scoped_ptr.h"
|
| #include "chrome/browser/ui/views/frame/browser_non_client_frame_view.h"
|
| -#include "ui/views/controls/button/button.h"
|
| -#include "ui/views/widget/widget.h"
|
| +#include "chrome/browser/ui/views/tab_icon_view.h"
|
| +#include "ui/views/controls/button/button.h" // ButtonListener
|
|
|
| -class BrowserFrame;
|
| -class BrowserView;
|
| -class FrameBackgroundView;
|
| -class WindowControlButton;
|
| +namespace views {
|
| +class FrameBackground;
|
| +class ImageButton;
|
| +}
|
|
|
| class BrowserNonClientFrameViewAura : public BrowserNonClientFrameView,
|
| public views::ButtonListener,
|
| - public views::Widget::Observer,
|
| - public ash::WindowFrame {
|
| + public TabIconView::TabIconViewModel {
|
| public:
|
| BrowserNonClientFrameViewAura(BrowserFrame* frame, BrowserView* browser_view);
|
| virtual ~BrowserNonClientFrameViewAura();
|
|
|
| - // Control the slide-in animation of the frame background.
|
| - void ShowFrameBackground();
|
| - void HideFrameBackground();
|
| -
|
| - private:
|
| - // Returns a HitTest code.
|
| - int NonClientHitTestImpl(const gfx::Point& point);
|
| -
|
| - // Returns the target rectangle for the frame background, based on a mouse
|
| - // position from |hittest_code| and the window's active/inactive state.
|
| - // Pass HTNOWHERE to get default bounds.
|
| - gfx::Rect GetFrameBackgroundBounds(int hittest_code, bool active_window);
|
| -
|
| - // Recomputes the bounds of the semi-transparent frame background.
|
| - void UpdateFrameBackground(bool active_window);
|
| -
|
| - // Invoked when the active state changes.
|
| - void ActiveStateChanged();
|
| + void Init();
|
|
|
| // BrowserNonClientFrameView overrides:
|
| virtual gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const OVERRIDE;
|
| @@ -58,32 +39,57 @@ class BrowserNonClientFrameViewAura : public BrowserNonClientFrameView,
|
| gfx::Path* window_mask) OVERRIDE;
|
| virtual void ResetWindowControls() OVERRIDE;
|
| virtual void UpdateWindowIcon() OVERRIDE;
|
| - virtual void ShouldPaintAsActiveChanged() OVERRIDE;
|
|
|
| // views::View overrides:
|
| + virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE;
|
| virtual void Layout() OVERRIDE;
|
| - virtual views::View* GetEventHandlerForPoint(
|
| - const gfx::Point& point) OVERRIDE;
|
| - virtual bool HitTest(const gfx::Point& p) const OVERRIDE;
|
| - virtual void OnMouseMoved(const views::MouseEvent& event) OVERRIDE;
|
| - virtual void OnMouseExited(const views::MouseEvent& event) OVERRIDE;
|
| - virtual gfx::NativeCursor GetCursor(const views::MouseEvent& event) OVERRIDE;
|
| + virtual bool HitTest(const gfx::Point& l) const OVERRIDE;
|
| + virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
|
|
|
| // views::ButtonListener overrides:
|
| virtual void ButtonPressed(views::Button* sender,
|
| const views::Event& event) OVERRIDE;
|
|
|
| - // views::Widget::Observer overrides:
|
| - virtual void OnWidgetActivationChanged(views::Widget* widget,
|
| - bool active) OVERRIDE;
|
| -
|
| - // ash::WindowFrame overrides:
|
| - virtual void OnWindowHoverChanged(bool hovered) OVERRIDE;
|
| + // Overridden from TabIconView::TabIconViewModel:
|
| + virtual bool ShouldTabIconViewAnimate() const OVERRIDE;
|
| + virtual SkBitmap GetFaviconForTabIconView() OVERRIDE;
|
|
|
| - int last_hittest_code_;
|
| - WindowControlButton* maximize_button_;
|
| - WindowControlButton* close_button_;
|
| - FrameBackgroundView* frame_background_;
|
| + private:
|
| + // Sets the images for a button base on IDs from the frame's theme provider.
|
| + void SetButtonImages(views::ImageButton* button,
|
| + int normal_bitmap_id,
|
| + int hot_bitmap_id,
|
| + int pushed_bitmap_id);
|
| +
|
| + // Distance between top of window and client area.
|
| + int NonClientTopBorderHeight(bool restored) const;
|
| +
|
| + void PaintHeader(gfx::Canvas* canvas);
|
| + void PaintTitleBar(gfx::Canvas* canvas);
|
| +
|
| + // Returns the correct bitmap for the frame header based on activation state
|
| + // and incognito mode.
|
| + SkBitmap* GetThemeFrameBitmap() const;
|
| + SkBitmap* GetThemeFrameOverlayBitmap() const;
|
| +
|
| + // Returns the theme image bitmap for |bitmap_id| if the user has a custom
|
| + // theme image, or the bitmap for |fallback_bitmap_id| if not.
|
| + SkBitmap* GetCustomBitmap(int bitmap_id, int fallback_bitmap_id) const;
|
| +
|
| + // Window controls.
|
| + views::ImageButton* maximize_button_;
|
| + views::ImageButton* close_button_;
|
| +
|
| + // For popups, the window icon.
|
| + TabIconView* window_icon_;
|
| +
|
| + // Window frame header/caption parts.
|
| + SkBitmap* button_separator_;
|
| + SkBitmap* top_left_corner_;
|
| + SkBitmap* top_edge_;
|
| + SkBitmap* top_right_corner_;
|
| + SkBitmap* header_left_edge_;
|
| + SkBitmap* header_right_edge_;
|
|
|
| DISALLOW_COPY_AND_ASSIGN(BrowserNonClientFrameViewAura);
|
| };
|
|
|