summaryrefslogtreecommitdiffstats
path: root/chrome/browser
diff options
context:
space:
mode:
authoroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 23:32:42 +0000
committeroshima@chromium.org <oshima@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-02-12 23:32:42 +0000
commit17e642245e8a061218fb618b9fbe082e4dc852b7 (patch)
treee6e95bdbc85dbc812bccbd8b5a9c6ad0f9c751b7 /chrome/browser
parent8a786e774a3baabd28cc62271cf6ca7e4bf51d76 (diff)
downloadchromium_src-17e642245e8a061218fb618b9fbe082e4dc852b7.zip
chromium_src-17e642245e8a061218fb618b9fbe082e4dc852b7.tar.gz
chromium_src-17e642245e8a061218fb618b9fbe082e4dc852b7.tar.bz2
Moved chromeos's frame classes under chromeos/frame.
- Made Init in BrowserFrameGtk virtual so that chromeos can use it's own frame view. - Introduced BrowserFrameChromeos (which is currently empty) BUG=none TEST=none Review URL: http://codereview.chromium.org/606014 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@38980 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser')
-rw-r--r--chrome/browser/chromeos/frame/browser_extenders.cc (renamed from chrome/browser/chromeos/browser_extenders.cc)4
-rw-r--r--chrome/browser/chromeos/frame/browser_frame_chromeos.cc31
-rw-r--r--chrome/browser/chromeos/frame/browser_frame_chromeos.h25
-rw-r--r--chrome/browser/chromeos/frame/browser_view.cc (renamed from chrome/browser/chromeos/browser_view.cc)4
-rw-r--r--chrome/browser/chromeos/frame/browser_view.h (renamed from chrome/browser/chromeos/browser_view.h)6
-rw-r--r--chrome/browser/chromeos/frame/panel_browser_view.cc (renamed from chrome/browser/chromeos/panel_browser_view.cc)4
-rw-r--r--chrome/browser/chromeos/frame/panel_browser_view.h (renamed from chrome/browser/chromeos/panel_browser_view.h)8
-rw-r--r--chrome/browser/chromeos/frame/panel_controller.cc (renamed from chrome/browser/chromeos/panel_controller.cc)4
-rw-r--r--chrome/browser/chromeos/frame/panel_controller.h (renamed from chrome/browser/chromeos/panel_controller.h)8
-rw-r--r--chrome/browser/chromeos/main_menu.cc2
-rw-r--r--chrome/browser/chromeos/notifications/notification_panel.h2
-rwxr-xr-xchrome/browser/chromeos/status/browser_status_area_view.cc2
-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
15 files changed, 97 insertions, 31 deletions
diff --git a/chrome/browser/chromeos/browser_extenders.cc b/chrome/browser/chromeos/frame/browser_extenders.cc
index be06eb2..94eae29 100644
--- a/chrome/browser/chromeos/browser_extenders.cc
+++ b/chrome/browser/chromeos/frame/browser_extenders.cc
@@ -1,4 +1,4 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
@@ -9,7 +9,7 @@
#include "app/theme_provider.h"
#include "base/command_line.h"
#include "chrome/app/chrome_dll_resource.h"
-#include "chrome/browser/chromeos/browser_view.h"
+#include "chrome/browser/chromeos/frame/browser_view.h"
#include "chrome/browser/chromeos/compact_location_bar_host.h"
#include "chrome/browser/chromeos/compact_navigation_bar.h"
#include "chrome/browser/chromeos/main_menu.h"
diff --git a/chrome/browser/chromeos/frame/browser_frame_chromeos.cc b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc
new file mode 100644
index 0000000..001ab0e
--- /dev/null
+++ b/chrome/browser/chromeos/frame/browser_frame_chromeos.cc
@@ -0,0 +1,31 @@
+// Copyright (c) 2010 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.
+
+#include "chrome/browser/chromeos/frame/browser_frame_chromeos.h"
+
+// static (Factory method.)
+BrowserFrame* BrowserFrame::Create(BrowserView* browser_view,
+ Profile* profile) {
+ chromeos::BrowserFrameChromeos* frame =
+ new chromeos::BrowserFrameChromeos(browser_view, profile);
+ frame->Init();
+ return frame;
+}
+
+namespace chromeos {
+
+BrowserFrameChromeos::BrowserFrameChromeos(
+ BrowserView* browser_view, Profile* profile)
+ : BrowserFrameGtk(browser_view, profile) {
+}
+
+BrowserFrameChromeos::~BrowserFrameChromeos() {
+}
+
+void BrowserFrameChromeos::Init() {
+ // TODO(oshima)::Create chromeos specific frame view.
+ BrowserFrameGtk::Init();
+}
+
+} // namespace chromeos
diff --git a/chrome/browser/chromeos/frame/browser_frame_chromeos.h b/chrome/browser/chromeos/frame/browser_frame_chromeos.h
new file mode 100644
index 0000000..23abbfa
--- /dev/null
+++ b/chrome/browser/chromeos/frame/browser_frame_chromeos.h
@@ -0,0 +1,25 @@
+// Copyright (c) 2010 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_CHROMEOS_FRAME_BROWSER_FRAME_CHROMEOS_H_
+#define CHROME_BROWSER_CHROMEOS_FRAME_BROWSER_FRAME_CHROMEOS_H_
+
+#include "chrome/browser/views/frame/browser_frame_gtk.h"
+
+namespace chromeos {
+
+class BrowserFrameChromeos : public BrowserFrameGtk {
+ public:
+ BrowserFrameChromeos(BrowserView* browser_view, Profile* profile);
+ virtual ~BrowserFrameChromeos();
+
+ // BrowserFrameGtk overrides.
+ virtual void Init();
+
+ DISALLOW_COPY_AND_ASSIGN(BrowserFrameChromeos);
+};
+
+} // namespace chroemos
+
+#endif // CHROME_BROWSER_CHROMEOS_FRAME_BROWSER_FRAME_CHROMEOS_H_
diff --git a/chrome/browser/chromeos/browser_view.cc b/chrome/browser/chromeos/frame/browser_view.cc
index d689a6e..3ebe1d7 100644
--- a/chrome/browser/chromeos/browser_view.cc
+++ b/chrome/browser/chromeos/frame/browser_view.cc
@@ -2,7 +2,7 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/browser_view.h"
+#include "chrome/browser/chromeos/frame/browser_view.h"
#include <algorithm>
#include <string>
@@ -14,8 +14,8 @@
#include "chrome/app/chrome_dll_resource.h"
#include "chrome/browser/chromeos/compact_location_bar_host.h"
#include "chrome/browser/chromeos/compact_navigation_bar.h"
+#include "chrome/browser/chromeos/frame/panel_browser_view.h"
#include "chrome/browser/chromeos/main_menu.h"
-#include "chrome/browser/chromeos/panel_browser_view.h"
#include "chrome/browser/chromeos/status/browser_status_area_view.h"
#include "chrome/browser/chromeos/status/status_area_button.h"
#include "chrome/browser/view_ids.h"
diff --git a/chrome/browser/chromeos/browser_view.h b/chrome/browser/chromeos/frame/browser_view.h
index dbdc0c2..fe6a65e 100644
--- a/chrome/browser/chromeos/browser_view.h
+++ b/chrome/browser/chromeos/frame/browser_view.h
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_BROWSER_VIEW_H_
-#define CHROME_BROWSER_CHROMEOS_BROWSER_VIEW_H_
+#ifndef CHROME_BROWSER_CHROMEOS_FRAME_BROWSER_VIEW_H_
+#define CHROME_BROWSER_CHROMEOS_FRAME_BROWSER_VIEW_H_
#include "chrome/browser/chromeos/status/status_area_host.h"
#include "chrome/browser/views/frame/browser_view.h"
@@ -132,4 +132,4 @@ class BrowserView : public ::BrowserView,
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_BROWSER_VIEW_H_
+#endif // CHROME_BROWSER_CHROMEOS_FRAME_BROWSER_VIEW_H_
diff --git a/chrome/browser/chromeos/panel_browser_view.cc b/chrome/browser/chromeos/frame/panel_browser_view.cc
index 3981af5..1a683ba 100644
--- a/chrome/browser/chromeos/panel_browser_view.cc
+++ b/chrome/browser/chromeos/frame/panel_browser_view.cc
@@ -2,9 +2,9 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#include "chrome/browser/chromeos/panel_browser_view.h"
+#include "chrome/browser/chromeos/frame/panel_browser_view.h"
-#include "chrome/browser/chromeos/panel_controller.h"
+#include "chrome/browser/chromeos/frame/panel_controller.h"
#include "views/window/window.h"
namespace chromeos {
diff --git a/chrome/browser/chromeos/panel_browser_view.h b/chrome/browser/chromeos/frame/panel_browser_view.h
index b269b3b..0bd7c6f8 100644
--- a/chrome/browser/chromeos/panel_browser_view.h
+++ b/chrome/browser/chromeos/frame/panel_browser_view.h
@@ -2,11 +2,11 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
-#ifndef CHROME_BROWSER_CHROMEOS_PANEL_BROWSER_VIEW_H_
-#define CHROME_BROWSER_CHROMEOS_PANEL_BROWSER_VIEW_H_
+#ifndef CHROME_BROWSER_CHROMEOS_FRAME_PANEL_BROWSER_VIEW_H_
+#define CHROME_BROWSER_CHROMEOS_FRAME_PANEL_BROWSER_VIEW_H_
#include "base/scoped_ptr.h"
-#include "chrome/browser/chromeos/panel_controller.h"
+#include "chrome/browser/chromeos/frame/panel_controller.h"
#include "chrome/browser/views/frame/browser_view.h"
class Browser;
@@ -42,4 +42,4 @@ class PanelBrowserView : public BrowserView,
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_PANEL_BROWSER_VIEW_H_
+#endif // CHROME_BROWSER_CHROMEOS_FRAME_PANEL_BROWSER_VIEW_H_
diff --git a/chrome/browser/chromeos/panel_controller.cc b/chrome/browser/chromeos/frame/panel_controller.cc
index 0019fbf..2e53cd63 100644
--- a/chrome/browser/chromeos/panel_controller.cc
+++ b/chrome/browser/chromeos/frame/panel_controller.cc
@@ -1,8 +1,8 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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.
-#include "chrome/browser/chromeos/panel_controller.h"
+#include "chrome/browser/chromeos/frame/panel_controller.h"
#include <vector>
diff --git a/chrome/browser/chromeos/panel_controller.h b/chrome/browser/chromeos/frame/panel_controller.h
index ff2055f..cac3ed0 100644
--- a/chrome/browser/chromeos/panel_controller.h
+++ b/chrome/browser/chromeos/frame/panel_controller.h
@@ -1,9 +1,9 @@
-// Copyright (c) 2009 The Chromium Authors. All rights reserved.
+// Copyright (c) 2010 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_CHROMEOS_PANEL_CONTROLLER_H_
-#define CHROME_BROWSER_CHROMEOS_PANEL_CONTROLLER_H_
+#ifndef CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_
+#define CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_
#include <gtk/gtk.h>
@@ -131,4 +131,4 @@ class PanelController : public views::ButtonListener {
} // namespace chromeos
-#endif // CHROME_BROWSER_CHROMEOS_PANEL_CONTROLLER_H_
+#endif // CHROME_BROWSER_CHROMEOS_FRAME_PANEL_CONTROLLER_H_
diff --git a/chrome/browser/chromeos/main_menu.cc b/chrome/browser/chromeos/main_menu.cc
index e8609ac..3c30f7a 100644
--- a/chrome/browser/chromeos/main_menu.cc
+++ b/chrome/browser/chromeos/main_menu.cc
@@ -19,7 +19,7 @@
#include "chrome/browser/browser_list.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/bubble_positioner.h"
-#include "chrome/browser/chromeos/browser_view.h"
+#include "chrome/browser/chromeos/frame/browser_view.h"
#include "chrome/browser/chromeos/status/status_area_view.h"
#include "chrome/browser/in_process_webkit/dom_storage_context.h"
#include "chrome/browser/in_process_webkit/webkit_context.h"
diff --git a/chrome/browser/chromeos/notifications/notification_panel.h b/chrome/browser/chromeos/notifications/notification_panel.h
index 5a02441..2e6dad5 100644
--- a/chrome/browser/chromeos/notifications/notification_panel.h
+++ b/chrome/browser/chromeos/notifications/notification_panel.h
@@ -10,7 +10,7 @@
#include "base/gfx/rect.h"
#include "base/scoped_ptr.h"
#include "base/singleton.h"
-#include "chrome/browser/chromeos/panel_controller.h"
+#include "chrome/browser/chromeos/frame/panel_controller.h"
class BalloonViewImpl;
diff --git a/chrome/browser/chromeos/status/browser_status_area_view.cc b/chrome/browser/chromeos/status/browser_status_area_view.cc
index e9952cc..ead0eae 100755
--- a/chrome/browser/chromeos/status/browser_status_area_view.cc
+++ b/chrome/browser/chromeos/status/browser_status_area_view.cc
@@ -12,7 +12,7 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/browser_theme_provider.h"
-#include "chrome/browser/chromeos/browser_view.h"
+#include "chrome/browser/chromeos/frame/browser_view.h"
#include "chrome/browser/chromeos/status/status_area_button.h"
#include "chrome/browser/chromeos/status/status_area_view.h"
#include "chrome/browser/profile.h"
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 {