summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame/browser_frame_win.cc
diff options
context:
space:
mode:
authorrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-04 16:08:29 +0000
committerrafaelw@chromium.org <rafaelw@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-04 16:08:29 +0000
commitf298901fdf7b438d12b776407026eec114e3682b (patch)
treeb0931bef4c62eca2a6b674d7f692d25694628edf /chrome/browser/views/frame/browser_frame_win.cc
parent3bd19b38ccaedafc2dd6dd8359b7a2083e7fdae7 (diff)
downloadchromium_src-f298901fdf7b438d12b776407026eec114e3682b.zip
chromium_src-f298901fdf7b438d12b776407026eec114e3682b.tar.gz
chromium_src-f298901fdf7b438d12b776407026eec114e3682b.tar.bz2
Step 1 in Implementing/Prototyping App Panels.
In this first step we 1) Create a new Browser::Type::TYPE_APP_PANEL which is observed in various places 2) Create an AppPanelBrowserFrame which is created in BrowserFrameWin when the TYPE_APP_PANEL is observed. AppPanelBrowserFrame draws itself per glen's mocks and will ultimately behave substantially different from regular browser windows. 3) Create a temporary command switch called --app-launch-as-panel which can be used until we implement actual app launching. Note that there is still work to be done "bit-twiddling" to match glen's mocks and to implement the "inactive" look for these windows. Steps 2 through N may include: different sizing behavior (based either on the content size or an api call), different min/maximize behavior, docking to the os taskbar, auto order & placement of app panels. A screen capture of the current implementation is attached to the bug. BUG=32361 Review URL: http://codereview.chromium.org/553143 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38107 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/views/frame/browser_frame_win.cc')
-rw-r--r--chrome/browser/views/frame/browser_frame_win.cc30
1 files changed, 22 insertions, 8 deletions
diff --git a/chrome/browser/views/frame/browser_frame_win.cc b/chrome/browser/views/frame/browser_frame_win.cc
index 61aa053..75b3126d3 100644
--- a/chrome/browser/views/frame/browser_frame_win.cc
+++ b/chrome/browser/views/frame/browser_frame_win.cc
@@ -15,6 +15,7 @@
#include "chrome/browser/profile.h"
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_theme_provider.h"
+#include "chrome/browser/views/frame/app_panel_browser_frame_view.h"
#include "chrome/browser/views/frame/browser_non_client_frame_view.h"
#include "chrome/browser/views/frame/browser_root_view.h"
#include "chrome/browser/views/frame/browser_view.h"
@@ -36,6 +37,12 @@ BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
return frame;
}
+// static
+const gfx::Font& BrowserFrame::GetTitleFont() {
+ static gfx::Font* title_font = new gfx::Font(win_util::GetWindowTitleFont());
+ return *title_font;
+}
+
///////////////////////////////////////////////////////////////////////////////
// BrowserFrame, public:
@@ -97,14 +104,19 @@ ThemeProvider* BrowserFrameWin::GetThemeProviderForFrame() const {
}
bool BrowserFrameWin::AlwaysUseNativeFrame() const {
- // We use the native frame when we're told we should by the theme provider
- // (e.g. no custom theme is active), or when we're a popup or app window. We
- // don't theme popup or app windows, so regardless of whether or not a theme
- // is active for normal browser windows, we don't want to use the custom frame
- // for popups/apps.
- return GetThemeProvider()->ShouldUseNativeFrame() ||
- (!browser_view_->IsBrowserTypeNormal() &&
- win_util::ShouldUseVistaFrame());
+ // App panel windows draw their own frame.
+ if (browser_view_->IsBrowserTypePanel())
+ return false;
+
+ // We don't theme popup or app windows, so regardless of whether or not a
+ // theme is active for normal browser windows, we don't want to use the custom
+ // frame for popups/apps.
+ if (!browser_view_->IsBrowserTypeNormal() && win_util::ShouldUseVistaFrame())
+ return true;
+
+ // Otherwise, we use the native frame when we're told we should by the theme
+ // provider (e.g. no custom theme is active).
+ return GetThemeProvider()->ShouldUseNativeFrame();
}
views::View* BrowserFrameWin::GetFrameView() const {
@@ -225,6 +237,8 @@ int BrowserFrameWin::GetShowState() const {
views::NonClientFrameView* BrowserFrameWin::CreateFrameViewForWindow() {
if (AlwaysUseNativeFrame())
browser_frame_view_ = new GlassBrowserFrameView(this, browser_view_);
+ else if (browser_view_->IsBrowserTypePanel())
+ browser_frame_view_ = new AppPanelBrowserFrameView(this, browser_view_);
else
browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_);
return browser_frame_view_;