Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(130)

Unified Diff: chrome/browser/ui/panels/panel_titlebar_gtk.h

Issue 10831226: Panels refactor: Support browserless panels on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/panels/panel_titlebar_gtk.h
diff --git a/chrome/browser/ui/panels/panel_browser_titlebar_gtk.h b/chrome/browser/ui/panels/panel_titlebar_gtk.h
similarity index 57%
copy from chrome/browser/ui/panels/panel_browser_titlebar_gtk.h
copy to chrome/browser/ui/panels/panel_titlebar_gtk.h
index 954d76265991230c68830ebfdcbbe2c4c3c1ddd4..ddfa45250357eca8ac0fffe23ff4276f656813ad 100644
--- a/chrome/browser/ui/panels/panel_browser_titlebar_gtk.h
+++ b/chrome/browser/ui/panels/panel_titlebar_gtk.h
@@ -2,35 +2,30 @@
// 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_BROWSER_TITLEBAR_GTK_H_
-#define CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_
+#ifndef CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_GTK_H_
+#define CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_GTK_H_
#include <gtk/gtk.h>
#include "base/compiler_specific.h"
#include "base/memory/scoped_ptr.h"
-#include "chrome/browser/ui/gtk/browser_titlebar_base.h"
#include "chrome/browser/ui/gtk/titlebar_throb_animation.h"
#include "chrome/browser/ui/panels/panel_constants.h"
-#include "content/public/browser/notification_observer.h"
-#include "content/public/browser/notification_registrar.h"
#include "ui/base/gtk/gtk_signal.h"
#include "ui/gfx/skia_util.h"
class CustomDrawButton;
class GtkThemeService;
-class PanelBrowserWindowGtk;
+class PanelGtk;
namespace content {
class WebContents;
}
-class PanelBrowserTitlebarGtk : public BrowserTitlebarBase,
- public content::NotificationObserver {
+class PanelTitlebarGtk {
public:
- PanelBrowserTitlebarGtk(PanelBrowserWindowGtk* browser_window,
- GtkWindow* window);
- virtual ~PanelBrowserTitlebarGtk();
+ explicit PanelTitlebarGtk(PanelGtk* panel_gtk);
+ virtual ~PanelTitlebarGtk();
void UpdateTextColor();
void UpdateMinimizeRestoreButtonVisibility();
@@ -47,23 +42,13 @@ class PanelBrowserTitlebarGtk : public BrowserTitlebarBase,
// https://bugzilla.gnome.org/show_bug.cgi?id=667841
void SendEnterNotifyToCloseButtonIfUnderMouse();
- // Overriden from BrowserTitlebarBase.
- virtual void Init() OVERRIDE;
- virtual void UpdateTitleAndIcon() OVERRIDE;
- virtual void UpdateCustomFrame(bool use_custom_frame) OVERRIDE;
- virtual void UpdateThrobber(content::WebContents* web_contents) OVERRIDE;
- virtual void ShowContextMenu(GdkEventButton* event) OVERRIDE;
- virtual GtkWidget* widget() const OVERRIDE;
- virtual void set_window(GtkWindow* window) OVERRIDE;
- virtual AvatarMenuButtonGtk* avatar_button() const OVERRIDE;
+ void Init();
+ void UpdateTitleAndIcon();
+ void UpdateThrobber(content::WebContents* web_contents);
+ GtkWidget* widget() const;
private:
- friend class NativePanelTestingGtk;
-
- // Overridden from content::NotificationObserver:
- virtual void Observe(int type,
- const content::NotificationSource& source,
- const content::NotificationDetails& details) OVERRIDE;
+ friend class GtkNativePanelTesting;
void BuildButtons();
CustomDrawButton* CreateButton(panel::TitlebarButtonType button_type);
@@ -74,13 +59,8 @@ class PanelBrowserTitlebarGtk : public BrowserTitlebarBase,
int* tooltip_id) const;
GtkWidget* GetButtonHBox();
- // Callback for changes to window state. This includes minimizing/restoring
- // the window.
- CHROMEG_CALLBACK_1(PanelBrowserTitlebarGtk, gboolean, OnWindowStateChanged,
- GtkWindow*, GdkEventWindowState*);
-
// Callback for minimize/restore/close buttons.
- CHROMEGTK_CALLBACK_0(PanelBrowserTitlebarGtk, void, OnButtonClicked);
+ CHROMEGTK_CALLBACK_0(PanelTitlebarGtk, void, OnButtonClicked);
CustomDrawButton* close_button() const { return close_button_.get(); }
CustomDrawButton* minimize_button() const { return minimize_button_.get(); }
@@ -88,9 +68,8 @@ class PanelBrowserTitlebarGtk : public BrowserTitlebarBase,
SkColor GetTextColor() const;
- // Pointers to the browser window that owns us and its GtkWindow.
- PanelBrowserWindowGtk* browser_window_;
- GtkWindow* window_;
+ // Pointers to the native panel window that owns us and its GtkWindow.
+ PanelGtk* panel_gtk_;
// The container widget the holds the hbox which contains the whole titlebar.
GtkWidget* container_;
@@ -112,9 +91,8 @@ class PanelBrowserTitlebarGtk : public BrowserTitlebarBase,
TitlebarThrobAnimation throbber_;
GtkThemeService* theme_service_;
- content::NotificationRegistrar registrar_;
- DISALLOW_COPY_AND_ASSIGN(PanelBrowserTitlebarGtk);
+ DISALLOW_COPY_AND_ASSIGN(PanelTitlebarGtk);
};
-#endif // CHROME_BROWSER_UI_PANELS_PANEL_BROWSER_TITLEBAR_GTK_H_
+#endif // CHROME_BROWSER_UI_PANELS_PANEL_TITLEBAR_GTK_H_

Powered by Google App Engine
This is Rietveld 408576698