blob: 4fc1661e6adfdd16d9fe89f1b774d7dffbf67edf [file] [log] [blame]
[email protected]7947f2162011-03-11 05:28:371// Copyright (c) 2011 The Chromium Authors. All rights reserved.
[email protected]213dac22010-11-09 07:35:322// 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_FRAME_BROWSER_FRAME_H_
6#define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_
7#pragma once
8
[email protected]883ce2f2011-03-14 23:53:459#include "base/compiler_specific.h"
[email protected]7947f2162011-03-11 05:28:3710#include "base/logging.h"
[email protected]213dac22010-11-09 07:35:3211#include "build/build_config.h"
[email protected]7947f2162011-03-11 05:28:3712#include "chrome/browser/ui/views/frame/native_browser_frame_delegate.h"
[email protected]2fdd00a2011-06-13 21:56:2613#include "views/widget/widget.h"
[email protected]213dac22010-11-09 07:35:3214
[email protected]883ce2f2011-03-14 23:53:4515class AeroGlassNonClientView;
16class BrowserNonClientFrameView;
17class BrowserRootView;
[email protected]213dac22010-11-09 07:35:3218class BrowserView;
[email protected]7947f2162011-03-11 05:28:3719class NativeBrowserFrame;
[email protected]883ce2f2011-03-14 23:53:4520class NonClientFrameView;
[email protected]213dac22010-11-09 07:35:3221class Profile;
[email protected]213dac22010-11-09 07:35:3222
23namespace gfx {
24class Font;
25class Rect;
[email protected]7947f2162011-03-11 05:28:3726}
[email protected]213dac22010-11-09 07:35:3227
[email protected]9dd7e3d72011-01-20 18:27:0628namespace ui {
29class ThemeProvider;
30}
31
[email protected]213dac22010-11-09 07:35:3232namespace views {
[email protected]7947f2162011-03-11 05:28:3733class View;
[email protected]7947f2162011-03-11 05:28:3734}
[email protected]213dac22010-11-09 07:35:3235
36// This is a virtual interface that allows system specific browser frames.
[email protected]2fdd00a2011-06-13 21:56:2637class BrowserFrame : public views::Widget {
[email protected]213dac22010-11-09 07:35:3238 public:
[email protected]9a56a0d2011-05-13 19:03:3139 explicit BrowserFrame(BrowserView* browser_view);
[email protected]7947f2162011-03-11 05:28:3740 virtual ~BrowserFrame();
[email protected]213dac22010-11-09 07:35:3241
[email protected]213dac22010-11-09 07:35:3242 static const gfx::Font& GetTitleFont();
43
[email protected]9a56a0d2011-05-13 19:03:3144 // Initialize the frame (creates the underlying native window).
45 void InitBrowserFrame();
[email protected]213dac22010-11-09 07:35:3246
47 // Determine the distance of the left edge of the minimize button from the
48 // left edge of the window. Used in our Non-Client View's Layout.
[email protected]7947f2162011-03-11 05:28:3749 int GetMinimizeButtonOffset() const;
[email protected]213dac22010-11-09 07:35:3250
51 // Retrieves the bounds, in non-client view coordinates for the specified
[email protected]e68d3df62011-02-14 18:46:4752 // TabStrip view.
[email protected]7947f2162011-03-11 05:28:3753 gfx::Rect GetBoundsForTabStrip(views::View* tabstrip) const;
[email protected]213dac22010-11-09 07:35:3254
55 // Returns the y coordinate within the window at which the horizontal TabStrip
56 // begins (or would begin). If |restored| is true, this is calculated as if
57 // we were in restored mode regardless of the current mode.
[email protected]7947f2162011-03-11 05:28:3758 int GetHorizontalTabStripVerticalOffset(bool restored) const;
[email protected]213dac22010-11-09 07:35:3259
60 // Tells the frame to update the throbber.
[email protected]7947f2162011-03-11 05:28:3761 void UpdateThrobber(bool running);
[email protected]213dac22010-11-09 07:35:3262
[email protected]213dac22010-11-09 07:35:3263 // Returns the NonClientFrameView of this frame.
[email protected]7947f2162011-03-11 05:28:3764 views::View* GetFrameView() const;
[email protected]213dac22010-11-09 07:35:3265
66 // Notifies the frame that the tab strip display mode changed so it can update
67 // its frame treatment if necessary.
[email protected]7947f2162011-03-11 05:28:3768 void TabStripDisplayModeChanged();
69
[email protected]2fdd00a2011-06-13 21:56:2670 // Overridden from views::Widget:
[email protected]9a56a0d2011-05-13 19:03:3171 virtual bool IsMaximized() const OVERRIDE;
[email protected]10946072011-05-20 15:40:4572 virtual views::internal::RootView* CreateRootView() OVERRIDE;
[email protected]9f2ea8762011-06-03 15:42:4673 virtual views::NonClientFrameView* CreateNonClientFrameView() OVERRIDE;
[email protected]9a56a0d2011-05-13 19:03:3174 virtual bool GetAccelerator(int command_id,
75 ui::Accelerator* accelerator) OVERRIDE;
76 virtual ui::ThemeProvider* GetThemeProvider() const OVERRIDE;
[email protected]68c477d2011-06-08 17:47:4377 virtual void OnNativeWidgetActivationChanged(bool active) OVERRIDE;
[email protected]7947f2162011-03-11 05:28:3778
79 private:
80 NativeBrowserFrame* native_browser_frame_;
81
[email protected]883ce2f2011-03-14 23:53:4582 // A weak reference to the root view associated with the window. We save a
83 // copy as a BrowserRootView to avoid evil casting later, when we need to call
84 // functions that only exist on BrowserRootView (versus RootView).
85 BrowserRootView* root_view_;
86
87 // A pointer to our NonClientFrameView as a BrowserNonClientFrameView.
88 BrowserNonClientFrameView* browser_frame_view_;
89
90 // The BrowserView is our ClientView. This is a pointer to it.
91 BrowserView* browser_view_;
92
[email protected]7947f2162011-03-11 05:28:3793 DISALLOW_COPY_AND_ASSIGN(BrowserFrame);
[email protected]213dac22010-11-09 07:35:3294};
95
96#endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_FRAME_H_