summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.cc23
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.h15
-rw-r--r--chrome/browser/views/frame/browser_frame_win.cc1
-rw-r--r--chrome/browser/views/frame/browser_frame_win.h15
-rw-r--r--chrome/browser/views/frame/browser_non_client_frame_view.h26
-rw-r--r--chrome/browser/views/frame/glass_browser_frame_view.h1
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.cc15
-rw-r--r--chrome/browser/views/frame/opaque_browser_frame_view.h3
-rw-r--r--chrome/chrome.gyp5
9 files changed, 82 insertions, 22 deletions
diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc
index e9ac7a2..2341e83 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/views/frame/browser_frame_gtk.cc
@@ -2,9 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "base/logging.h"
#include "chrome/browser/views/frame/browser_frame_gtk.h"
+
+#include "base/logging.h"
+#include "chrome/browser/views/frame/browser_root_view.h"
#include "chrome/browser/views/frame/browser_view.h"
+#include "chrome/browser/views/frame/opaque_browser_frame_view.h"
+#include "views/widget/root_view.h"
// static (Factory method.)
BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
@@ -17,9 +21,12 @@ BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
BrowserFrameGtk::BrowserFrameGtk(BrowserView* browser_view, Profile* profile)
: WindowGtk(browser_view),
browser_view_(browser_view),
+ browser_frame_view_(NULL),
+ root_view_(NULL),
profile_(profile) {
browser_view_->set_frame(this);
- GetNonClientView()->SetFrameView(CreateFrameViewForWindow());
+ browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_);
+ GetNonClientView()->SetFrameView(browser_frame_view_);
// Don't focus anything on creation, selecting a tab will set the focus.
}
@@ -35,7 +42,7 @@ views::Window* BrowserFrameGtk::GetWindow() {
}
void BrowserFrameGtk::TabStripCreated(TabStrip* tabstrip) {
- NOTIMPLEMENTED();
+ root_view_->set_tabstrip(tabstrip);
}
int BrowserFrameGtk::GetMinimizeButtonOffset() const {
@@ -44,14 +51,18 @@ int BrowserFrameGtk::GetMinimizeButtonOffset() const {
}
gfx::Rect BrowserFrameGtk::GetBoundsForTabStrip(TabStrip* tabstrip) const {
- NOTIMPLEMENTED();
- return gfx::Rect();
+ return browser_frame_view_->GetBoundsForTabStrip(tabstrip);
}
void BrowserFrameGtk::UpdateThrobber(bool running) {
- NOTIMPLEMENTED();
+ browser_frame_view_->UpdateThrobber(running);
}
ThemeProvider* BrowserFrameGtk::GetThemeProviderForFrame() const {
return profile_->GetThemeProvider();
}
+
+views::RootView* BrowserFrameGtk::CreateRootView() {
+ root_view_ = new BrowserRootView(this);
+ return root_view_;
+}
diff --git a/chrome/browser/views/frame/browser_frame_gtk.h b/chrome/browser/views/frame/browser_frame_gtk.h
index 650e24f..313340c 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.h
+++ b/chrome/browser/views/frame/browser_frame_gtk.h
@@ -9,6 +9,9 @@
#include "chrome/browser/views/frame/browser_frame.h"
#include "views/window/window_gtk.h"
+class BrowserNonClientFrameView;
+class BrowserRootView;
+
class BrowserFrameGtk : public BrowserFrame,
public views::WindowGtk {
public:
@@ -29,10 +32,22 @@ class BrowserFrameGtk : public BrowserFrame,
virtual void UpdateThrobber(bool running);
virtual ThemeProvider* GetThemeProviderForFrame() const;
+ protected:
+ // WidgetGtk overrides.
+ virtual views::RootView* CreateRootView();
+
private:
// The BrowserView is our ClientView. This is a pointer to it.
BrowserView* browser_view_;
+ // A pointer to our NonClientFrameView as a BrowserNonClientFrameView.
+ BrowserNonClientFrameView* browser_frame_view_;
+
+ // An unowning reference to the root view associated with the window. We save
+ // a copy as a BrowserRootView to avoid evil casting later, when we need to
+ // call functions that only exist on BrowserRootView (versus RootView).
+ BrowserRootView* root_view_;
+
Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(BrowserFrameGtk);
diff --git a/chrome/browser/views/frame/browser_frame_win.cc b/chrome/browser/views/frame/browser_frame_win.cc
index ee80b82..0e76a4d 100644
--- a/chrome/browser/views/frame/browser_frame_win.cc
+++ b/chrome/browser/views/frame/browser_frame_win.cc
@@ -11,6 +11,7 @@
#include "app/win_util.h"
#include "chrome/browser/profile.h"
#include "chrome/browser/browser_list.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"
#include "chrome/browser/views/frame/glass_browser_frame_view.h"
diff --git a/chrome/browser/views/frame/browser_frame_win.h b/chrome/browser/views/frame/browser_frame_win.h
index 90a5b30..a3aa30d 100644
--- a/chrome/browser/views/frame/browser_frame_win.h
+++ b/chrome/browser/views/frame/browser_frame_win.h
@@ -10,26 +10,13 @@
#include "views/window/window_win.h"
class AeroGlassNonClientView;
+class BrowserNonClientFrameView;
class BrowserRootView;
class BrowserView;
class NonClientFrameView;
class Profile;
class TabStrip;
-// A specialization of the NonClientFrameView object that provides additional
-// Browser-specific methods.
-class BrowserNonClientFrameView : public views::NonClientFrameView {
- public:
- BrowserNonClientFrameView() : NonClientFrameView() {}
- virtual ~BrowserNonClientFrameView() {}
-
- // Returns the bounds within which the TabStrip should be laid out.
- virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const = 0;
-
- // Updates the throbber.
- virtual void UpdateThrobber(bool running) = 0;
-};
-
///////////////////////////////////////////////////////////////////////////////
// BrowserFrameWin
//
diff --git a/chrome/browser/views/frame/browser_non_client_frame_view.h b/chrome/browser/views/frame/browser_non_client_frame_view.h
new file mode 100644
index 0000000..5b87d9e
--- /dev/null
+++ b/chrome/browser/views/frame/browser_non_client_frame_view.h
@@ -0,0 +1,26 @@
+// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_
+#define CHROME_BROWSER_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_
+
+#include "views/window/non_client_view.h"
+
+class TabStrip;
+
+// A specialization of the NonClientFrameView object that provides additional
+// Browser-specific methods.
+class BrowserNonClientFrameView : public views::NonClientFrameView {
+ public:
+ BrowserNonClientFrameView() : NonClientFrameView() {}
+ virtual ~BrowserNonClientFrameView() {}
+
+ // Returns the bounds within which the TabStrip should be laid out.
+ virtual gfx::Rect GetBoundsForTabStrip(TabStrip* tabstrip) const = 0;
+
+ // Updates the throbber.
+ virtual void UpdateThrobber(bool running) = 0;
+};
+
+#endif // #ifndef CHROME_BROWSER_VIEWS_FRAME_BROWSER_NON_CLIENT_FRAME_VIEW_
diff --git a/chrome/browser/views/frame/glass_browser_frame_view.h b/chrome/browser/views/frame/glass_browser_frame_view.h
index 53c964d..3700ff1 100644
--- a/chrome/browser/views/frame/glass_browser_frame_view.h
+++ b/chrome/browser/views/frame/glass_browser_frame_view.h
@@ -6,6 +6,7 @@
#define CHROME_BROWSER_VIEWS_FRAME_GLASS_BROWSER_FRAME_VIEW_H_
#include "chrome/browser/views/frame/browser_frame_win.h"
+#include "chrome/browser/views/frame/browser_non_client_frame_view.h"
#include "views/controls/button/button.h"
#include "views/window/non_client_view.h"
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.cc b/chrome/browser/views/frame/opaque_browser_frame_view.cc
index 27727cf..1bfaa21 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.cc
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.cc
@@ -10,7 +10,6 @@
#include "app/l10n_util.h"
#include "app/resource_bundle.h"
#include "app/theme_provider.h"
-#include "app/win_util.h"
#include "chrome/browser/browser_theme_provider.h"
#include "chrome/browser/views/frame/browser_frame.h"
#include "chrome/browser/views/frame/browser_view.h"
@@ -21,8 +20,17 @@
#include "grit/theme_resources.h"
#include "views/controls/button/image_button.h"
#include "views/widget/root_view.h"
+#include "views/window/window.h"
#include "views/window/window_resources.h"
+#if defined(OS_WIN)
+#include "app/win_util.h"
+#endif
+
+#if defined(OS_LINUX)
+#include "views/window/hit_test.h"
+#endif
+
// static
SkBitmap* OpaqueBrowserFrameView::distributor_logo_ = NULL;
gfx::Font* OpaqueBrowserFrameView::title_font_ = NULL;
@@ -969,7 +977,12 @@ void OpaqueBrowserFrameView::InitClass() {
void OpaqueBrowserFrameView::InitAppWindowResources() {
static bool initialized = false;
if (!initialized) {
+#if defined(OS_WIN)
title_font_ = new gfx::Font(win_util::GetWindowTitleFont());
+#else
+ NOTIMPLEMENTED();
+ title_font_ = new gfx::Font();
+#endif
initialized = true;
}
}
diff --git a/chrome/browser/views/frame/opaque_browser_frame_view.h b/chrome/browser/views/frame/opaque_browser_frame_view.h
index d62b8f0..4345d8c 100644
--- a/chrome/browser/views/frame/opaque_browser_frame_view.h
+++ b/chrome/browser/views/frame/opaque_browser_frame_view.h
@@ -5,7 +5,8 @@
#ifndef CHROME_BROWSER_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_
#define CHROME_BROWSER_VIEWS_FRAME_OPAQUE_BROWSER_FRAME_VIEW_H_
-#include "chrome/browser/views/frame/browser_frame_win.h"
+#include "chrome/browser/views/frame/browser_frame.h"
+#include "chrome/browser/views/frame/browser_non_client_frame_view.h"
#include "chrome/browser/views/tab_icon_view.h"
#include "views/controls/button/button.h"
#include "views/window/non_client_view.h"
diff --git a/chrome/chrome.gyp b/chrome/chrome.gyp
index 70bcee2..8545723 100644
--- a/chrome/chrome.gyp
+++ b/chrome/chrome.gyp
@@ -1406,6 +1406,7 @@
'browser/views/frame/browser_frame_gtk.h',
'browser/views/frame/browser_frame_win.cc',
'browser/views/frame/browser_frame_win.h',
+ 'browser/views/frame/browser_non_client_frame_view.h',
'browser/views/frame/browser_root_view.cc',
'browser/views/frame/browser_root_view.h',
'browser/views/frame/browser_view.cc',
@@ -1680,6 +1681,10 @@
['include', '^browser/views/toolbar_star_toggle.cc'],
['include', '^browser/views/frame/browser_frame_gtk.cc'],
['include', '^browser/views/frame/browser_frame_gtk.h'],
+ ['include', '^browser/views/frame/browser_root_view.cc'],
+ ['include', '^browser/views/frame/browser_root_view.h'],
+ ['include', '^browser/views/frame/opaque_browser_frame_view.cc'],
+ ['include', '^browser/views/frame/opaque_browser_frame_view.h'],
['include', '^browser/views/infobars/*'],
['include', '^browser/views/info_bubble.cc'],
['include', '^browser/views/info_bubble.h'],