summaryrefslogtreecommitdiffstats
path: root/chrome/browser/views/frame
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/views/frame')
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.cc16
-rw-r--r--chrome/browser/views/frame/browser_frame_gtk.h8
-rw-r--r--chrome/browser/views/frame/browser_view.h4
3 files changed, 19 insertions, 9 deletions
diff --git a/chrome/browser/views/frame/browser_frame_gtk.cc b/chrome/browser/views/frame/browser_frame_gtk.cc
index aa91d12..f999e8e 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.cc
+++ b/chrome/browser/views/frame/browser_frame_gtk.cc
@@ -57,6 +57,7 @@ class PopupNonClientFrameView : public BrowserNonClientFrameView {
}
+#if !defined(OS_CHROMEOS)
// static (Factory method.)
BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
Profile* profile) {
@@ -64,6 +65,7 @@ BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
frame->Init();
return frame;
}
+#endif
// static
const gfx::Font& BrowserFrame::GetTitleFont() {
@@ -78,19 +80,21 @@ BrowserFrameGtk::BrowserFrameGtk(BrowserView* browser_view, Profile* profile)
root_view_(NULL),
profile_(profile) {
browser_view_->set_frame(this);
- if (browser_view->browser()->type() == Browser::TYPE_POPUP)
- browser_frame_view_ = new PopupNonClientFrameView();
- else
- 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.
}
BrowserFrameGtk::~BrowserFrameGtk() {
}
void BrowserFrameGtk::Init() {
+ if (browser_frame_view_ == NULL) {
+ if (browser_view_->browser()->type() == Browser::TYPE_POPUP)
+ browser_frame_view_ = new PopupNonClientFrameView();
+ else
+ browser_frame_view_ = new OpaqueBrowserFrameView(this, browser_view_);
+ }
+ GetNonClientView()->SetFrameView(browser_frame_view_);
WindowGtk::Init(NULL, gfx::Rect());
+ // Don't focus anything on creation, selecting a tab will set the focus.
}
views::Window* BrowserFrameGtk::GetWindow() {
diff --git a/chrome/browser/views/frame/browser_frame_gtk.h b/chrome/browser/views/frame/browser_frame_gtk.h
index bbf3b29..4277b40 100644
--- a/chrome/browser/views/frame/browser_frame_gtk.h
+++ b/chrome/browser/views/frame/browser_frame_gtk.h
@@ -20,9 +20,11 @@ class BrowserFrameGtk : public BrowserFrame,
BrowserFrameGtk(BrowserView* browser_view, Profile* profile);
virtual ~BrowserFrameGtk();
- // This initialization function must be called after construction, it is
- // separate to avoid recursive calling of the frame from its constructor.
- void Init();
+ // Creates a frame view and initializes the window. This
+ // initialization function must be called after construction, it is
+ // separate to avoid recursive calling of the frame from its
+ // constructor.
+ virtual void Init();
// Overridden from BrowserFrame:
virtual views::Window* GetWindow();
diff --git a/chrome/browser/views/frame/browser_view.h b/chrome/browser/views/frame/browser_view.h
index 0496023..02fa1e0 100644
--- a/chrome/browser/views/frame/browser_view.h
+++ b/chrome/browser/views/frame/browser_view.h
@@ -203,6 +203,10 @@ class BrowserView : public BrowserWindow,
return browser_->type() == Browser::TYPE_APP_PANEL;
}
+ bool IsBrowserTypePopup() const {
+ return browser_->type() == Browser::TYPE_POPUP;
+ }
+
// Returns true if the frame containing this BrowserView should show the
// distributor logo.
bool ShouldShowDistributorLogo() const {