summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorprasadt@chromium.org <prasadt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 17:19:57 +0000
committerprasadt@chromium.org <prasadt@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-04-04 17:19:57 +0000
commited2f2713f5c308535f1dc99a995500241fe788b5 (patch)
treeefa1b199b1d6b0c58c7acda7dd18d504a66dd36d
parent5d34b2e746ad0f22ba7fc2a3b7e3579c233d0d32 (diff)
downloadchromium_src-ed2f2713f5c308535f1dc99a995500241fe788b5.zip
chromium_src-ed2f2713f5c308535f1dc99a995500241fe788b5.tar.gz
chromium_src-ed2f2713f5c308535f1dc99a995500241fe788b5.tar.bz2
Add a stub implementation for Panel class.
This class provides a platform independent implementation of BrowserWindow interface. This is the BrowserWindow instance that'll be created for panels. This contains a platform specific implementation of BrowserWindow that'll be used for actually creating the UI. TEST=none BUG=73936 modified: chrome/browser/ui/browser_window.h new file: chrome/browser/ui/panels/panel.cc new file: chrome/browser/ui/panels/panel.h modified: chrome/chrome_browser.gypi R=ben@chromium.org Review URL: http://codereview.chromium.org/6770021 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@80332 0039d316-1c4b-4281-b951-d872f2087c98
-rw-r--r--chrome/browser/ui/browser_window.h4
-rw-r--r--chrome/browser/ui/panels/panel.cc340
-rw-r--r--chrome/browser/ui/panels/panel.h127
-rw-r--r--chrome/chrome_browser.gypi2
4 files changed, 471 insertions, 2 deletions
diff --git a/chrome/browser/ui/browser_window.h b/chrome/browser/ui/browser_window.h
index 945222d..7ca40bd 100644
--- a/chrome/browser/ui/browser_window.h
+++ b/chrome/browser/ui/browser_window.h
@@ -45,6 +45,8 @@ class Extension;
// NOTE: All getters may return NULL.
class BrowserWindow {
public:
+ virtual ~BrowserWindow() {}
+
// Show the window, or activates it if it's already visible.
virtual void Show() = 0;
@@ -343,8 +345,6 @@ class BrowserWindow {
friend class BrowserList;
friend class BrowserView;
virtual void DestroyBrowser() = 0;
-
- virtual ~BrowserWindow() {}
};
#if defined(OS_WIN) || defined(TOOLKIT_VIEWS)
diff --git a/chrome/browser/ui/panels/panel.cc b/chrome/browser/ui/panels/panel.cc
new file mode 100644
index 0000000..8a9223c
--- /dev/null
+++ b/chrome/browser/ui/panels/panel.cc
@@ -0,0 +1,340 @@
+// Copyright (c) 2011 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 "base/logging.h"
+#include "chrome/browser/ui/panels/panel.h"
+#include "ui/gfx/rect.h"
+
+Panel::Panel(Browser* browser) {
+ NOTIMPLEMENTED();
+}
+
+Panel::~Panel() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Show() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowInactive() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::SetBounds(const gfx::Rect& bounds) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Close() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Activate() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Deactivate() {
+ NOTIMPLEMENTED();
+}
+
+bool Panel::IsActive() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void Panel::FlashFrame() {
+ NOTIMPLEMENTED();
+}
+
+gfx::NativeWindow Panel::GetNativeHandle() {
+ return browser_window_->GetNativeHandle();
+}
+
+BrowserWindowTesting* Panel::GetBrowserWindowTesting() {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+StatusBubble* Panel::GetStatusBubble() {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void Panel::SelectedTabToolbarSizeChanged(bool is_animating){
+ NOTIMPLEMENTED();
+}
+
+void Panel::UpdateTitleBar() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShelfVisibilityChanged() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::UpdateDevTools() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::UpdateLoadingAnimations(bool should_animate) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::SetStarredState(bool is_starred) {
+ NOTIMPLEMENTED();
+}
+
+gfx::Rect Panel::GetRestoredBounds() const {
+ NOTIMPLEMENTED();
+ return gfx::Rect();
+}
+
+gfx::Rect Panel::GetBounds() const {
+ NOTIMPLEMENTED();
+ return gfx::Rect();
+}
+
+bool Panel::IsMaximized() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void Panel::SetFullscreen(bool fullscreen) {
+ NOTIMPLEMENTED();
+}
+
+bool Panel::IsFullscreen() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool Panel::IsFullscreenBubbleVisible() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+LocationBar* Panel::GetLocationBar() const {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void Panel::SetFocusToLocationBar(bool select_all) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::UpdateReloadStopState(bool is_loading, bool force) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::UpdateToolbar(TabContentsWrapper* contents,
+ bool should_restore_state) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::FocusToolbar() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::FocusAppMenu() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::FocusBookmarksToolbar() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::FocusChromeOSStatus() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::RotatePaneFocus(bool forwards) {
+ NOTIMPLEMENTED();
+}
+
+bool Panel::IsBookmarkBarVisible() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool Panel::IsBookmarkBarAnimating() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool Panel::IsTabStripEditable() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+bool Panel::IsToolbarVisible() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void Panel::DisableInactiveFrame() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ConfirmSetDefaultSearchProvider(
+ TabContents* tab_contents,
+ TemplateURL* template_url,
+ TemplateURLModel* template_url_model) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ConfirmAddSearchProvider(const TemplateURL* template_url,
+ Profile* profile) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ToggleBookmarkBar() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowAboutChromeDialog() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowUpdateChromeDialog() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowTaskManager() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowBackgroundPages() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowBookmarkBubble(const GURL& url, bool already_bookmarked) {
+ NOTIMPLEMENTED();
+}
+
+bool Panel::IsDownloadShelfVisible() const {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+DownloadShelf* Panel::GetDownloadShelf() {
+ NOTIMPLEMENTED();
+ return NULL;
+}
+
+void Panel::ShowRepostFormWarningDialog(TabContents* tab_contents) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowCollectedCookiesDialog(TabContents* tab_contents) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowProfileErrorDialog(int message_id) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowThemeInstallBubble() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ConfirmBrowserCloseWithPendingDownloads() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
+ gfx::NativeWindow parent_window) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::UserChangedTheme() {
+ NOTIMPLEMENTED();
+}
+
+int Panel::GetExtraRenderViewHeight() const {
+ NOTIMPLEMENTED();
+ return -1;
+}
+
+void Panel::TabContentsFocused(TabContents* tab_contents) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowPageInfo(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ bool show_history) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowAppMenu() {
+ NOTIMPLEMENTED();
+}
+
+bool Panel::PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut) {
+ NOTIMPLEMENTED();
+ return false;
+}
+
+void Panel::HandleKeyboardEvent(const NativeWebKeyboardEvent& event) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowCreateWebAppShortcutsDialog(TabContentsWrapper* tab_contents) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowCreateChromeAppShortcutsDialog(Profile* profile,
+ const Extension* app) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Cut() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Copy() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::Paste() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ToggleTabStripMode() {
+ NOTIMPLEMENTED();
+}
+
+#if defined(OS_MACOSX)
+void Panel::OpenTabpose() {
+ NOTIMPLEMENTED();
+}
+#endif
+
+void Panel::PrepareForInstant() {
+ NOTIMPLEMENTED();
+}
+
+void Panel::ShowInstant(TabContentsWrapper* preview) {
+ NOTIMPLEMENTED();
+}
+
+void Panel::HideInstant(bool instant_is_active) {
+ NOTIMPLEMENTED();
+}
+
+gfx::Rect Panel::GetInstantBounds() {
+ NOTIMPLEMENTED();
+ return gfx::Rect();
+}
+
+#if defined(OS_CHROMEOS)
+void Panel::ShowKeyboardOverlay(gfx::NativeWindow owning_window) {
+ NOTIMPLEMENTED();
+}
+#endif
+
+void Panel::DestroyBrowser() {
+ NOTIMPLEMENTED();
+}
diff --git a/chrome/browser/ui/panels/panel.h b/chrome/browser/ui/panels/panel.h
new file mode 100644
index 0000000..1904e91
--- /dev/null
+++ b/chrome/browser/ui/panels/panel.h
@@ -0,0 +1,127 @@
+// Copyright (c) 2011 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_UI_PANELS_PANEL_H_
+#define CHROME_BROWSER_UI_PANELS_PANEL_H_
+#pragma once
+
+#include "chrome/browser/ui/browser_window.h"
+
+#include "base/memory/scoped_ptr.h"
+
+// A platform independent implementation of BrowserWindow for Panels. This
+// class would get the first crack at all the BrowserWindow calls for Panels and
+// do one or more of the following:
+// - Do nothing. The function is not relevant to Panels.
+// - Throw an exceptions. The function shouldn't be called for Panels.
+// - Do Panel specific platform independent processing and then invoke the
+// function on the platform specific BrowserWindow member. For example,
+// Panel size is restricted to certain limits.
+// - Invoke an appropriate PanelManager function to do stuff that might affect
+// other Panels. For example deleting a panel would rearrange other panels.
+class Panel : public BrowserWindow {
+ public:
+ explicit Panel(Browser* browser);
+ virtual ~Panel();
+
+ // BrowserWindow overrides.
+ virtual void Show();
+ virtual void ShowInactive();
+ virtual void SetBounds(const gfx::Rect& bounds);
+ virtual void Close();
+ virtual void Activate();
+ virtual void Deactivate();
+ virtual bool IsActive() const;
+ virtual void FlashFrame();
+ virtual gfx::NativeWindow GetNativeHandle();
+ virtual BrowserWindowTesting* GetBrowserWindowTesting();
+ virtual StatusBubble* GetStatusBubble();
+ virtual void SelectedTabToolbarSizeChanged(bool is_animating);
+ virtual void UpdateTitleBar();
+ virtual void ShelfVisibilityChanged();
+ virtual void UpdateDevTools();
+ virtual void UpdateLoadingAnimations(bool should_animate);
+ virtual void SetStarredState(bool is_starred);
+ virtual gfx::Rect GetRestoredBounds() const;
+ virtual gfx::Rect GetBounds() const;
+ virtual bool IsMaximized() const;
+ virtual void SetFullscreen(bool fullscreen);
+ virtual bool IsFullscreen() const;
+ virtual bool IsFullscreenBubbleVisible() const;
+ virtual LocationBar* GetLocationBar() const;
+ virtual void SetFocusToLocationBar(bool select_all);
+ virtual void UpdateReloadStopState(bool is_loading, bool force);
+ virtual void UpdateToolbar(TabContentsWrapper* contents,
+ bool should_restore_state);
+ virtual void FocusToolbar();
+ virtual void FocusAppMenu();
+ virtual void FocusBookmarksToolbar();
+ virtual void FocusChromeOSStatus();
+ virtual void RotatePaneFocus(bool forwards);
+ virtual bool IsBookmarkBarVisible() const;
+ virtual bool IsBookmarkBarAnimating() const;
+ virtual bool IsTabStripEditable() const;
+ virtual bool IsToolbarVisible() const;
+ virtual void DisableInactiveFrame();
+ virtual void ConfirmSetDefaultSearchProvider(
+ TabContents* tab_contents,
+ TemplateURL* template_url,
+ TemplateURLModel* template_url_model);
+ virtual void ConfirmAddSearchProvider(const TemplateURL* template_url,
+ Profile* profile);
+ virtual void ToggleBookmarkBar();
+ virtual void ShowAboutChromeDialog();
+ virtual void ShowUpdateChromeDialog();
+ virtual void ShowTaskManager();
+ virtual void ShowBackgroundPages();
+ virtual void ShowBookmarkBubble(const GURL& url, bool already_bookmarked);
+ virtual bool IsDownloadShelfVisible() const;
+ virtual DownloadShelf* GetDownloadShelf();
+ virtual void ShowRepostFormWarningDialog(TabContents* tab_contents);
+ virtual void ShowCollectedCookiesDialog(TabContents* tab_contents);
+ virtual void ShowProfileErrorDialog(int message_id);
+ virtual void ShowThemeInstallBubble();
+ virtual void ConfirmBrowserCloseWithPendingDownloads();
+ virtual void ShowHTMLDialog(HtmlDialogUIDelegate* delegate,
+ gfx::NativeWindow parent_window);
+ virtual void UserChangedTheme();
+ virtual int GetExtraRenderViewHeight() const;
+ virtual void TabContentsFocused(TabContents* tab_contents);
+ virtual void ShowPageInfo(Profile* profile,
+ const GURL& url,
+ const NavigationEntry::SSLStatus& ssl,
+ bool show_history);
+ virtual void ShowAppMenu();
+ virtual bool PreHandleKeyboardEvent(const NativeWebKeyboardEvent& event,
+ bool* is_keyboard_shortcut);
+ virtual void HandleKeyboardEvent(const NativeWebKeyboardEvent& event);
+ virtual void ShowCreateWebAppShortcutsDialog(
+ TabContentsWrapper* tab_contents);
+ virtual void ShowCreateChromeAppShortcutsDialog(Profile* profile,
+ const Extension* app);
+ virtual void Cut();
+ virtual void Copy();
+ virtual void Paste();
+ virtual void ToggleTabStripMode();
+#if defined(OS_MACOSX)
+ virtual void OpenTabpose();
+#endif
+ virtual void PrepareForInstant();
+ virtual void ShowInstant(TabContentsWrapper* preview);
+ virtual void HideInstant(bool instant_is_active);
+ virtual gfx::Rect GetInstantBounds();
+#if defined(OS_CHROMEOS)
+ virtual void ShowKeyboardOverlay(gfx::NativeWindow owning_window);
+#endif
+
+ protected:
+ virtual void DestroyBrowser();
+
+ private:
+ // Platform specifc BrowserWindow implementation for panels. It'd be one of
+ // PanelBrowserWindowGtk/PanelBrowserView/PanelBrowserWindowCocoa.
+ scoped_ptr<BrowserWindow> browser_window_;
+};
+
+#endif // CHROME_BROWSER_UI_PANELS_PANEL_H_
diff --git a/chrome/chrome_browser.gypi b/chrome/chrome_browser.gypi
index 7828c00b..ff73ccd 100644
--- a/chrome/chrome_browser.gypi
+++ b/chrome/chrome_browser.gypi
@@ -2714,6 +2714,8 @@
'browser/ui/options/options_window.h',
'browser/ui/options/show_options_url.cc',
'browser/ui/options/show_options_url.h',
+ 'browser/ui/panels/panel.cc',
+ 'browser/ui/panels/panel.h',
'browser/ui/search_engines/edit_search_engine_controller.cc',
'browser/ui/search_engines/edit_search_engine_controller.h',
'browser/ui/search_engines/keyword_editor_controller.cc',