summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
diff options
context:
space:
mode:
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_gtk.h')
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_gtk.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
index a56a55a..4759417 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_gtk.h
@@ -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.
@@ -10,23 +10,27 @@
#include "base/basictypes.h"
#include "base/scoped_ptr.h"
#include "chrome/browser/autocomplete/autocomplete_popup_view.h"
+#include "chrome/common/notification_observer.h"
+#include "chrome/common/notification_registrar.h"
#include "webkit/glue/window_open_disposition.h"
class AutocompleteEditModel;
class AutocompleteEditView;
class AutocompletePopupModel;
+class GtkThemeProvider;
class Profile;
class SkBitmap;
-class AutocompletePopupViewGtk : public AutocompletePopupView {
+class AutocompletePopupViewGtk : public AutocompletePopupView,
+ public NotificationObserver {
public:
AutocompletePopupViewGtk(AutocompleteEditView* edit_view,
AutocompleteEditModel* edit_model,
Profile* profile,
- const BubblePositioner* bubble_positioner);
+ GtkWidget* location_bar);
~AutocompletePopupViewGtk();
- // Implement the AutocompletePopupView interface.
+ // Overridden from AutocompletePopupView:
virtual bool IsOpen() const { return opened_; }
virtual void InvalidateLine(size_t line);
virtual void UpdatePopupAppearance();
@@ -34,6 +38,11 @@ class AutocompletePopupViewGtk : public AutocompletePopupView {
virtual void OnDragCanceled();
virtual AutocompletePopupModel* GetModel();
+ // Overridden from NotificationObserver:
+ virtual void Observe(NotificationType type,
+ const NotificationSource& source,
+ const NotificationDetails& details);
+
private:
void Show(size_t num_results);
void Hide();
@@ -79,7 +88,7 @@ class AutocompletePopupViewGtk : public AutocompletePopupView {
scoped_ptr<AutocompletePopupModel> model_;
AutocompleteEditView* edit_view_;
- const BubblePositioner* bubble_positioner_;
+ GtkWidget* location_bar_;
// Our popup window, which is the only widget used, and we paint it on our
// own. This widget shouldn't be exposed outside of this class.
@@ -87,6 +96,22 @@ class AutocompletePopupViewGtk : public AutocompletePopupView {
// The pango layout object created from the window, cached across exposes.
PangoLayout* layout_;
+ GtkThemeProvider* theme_provider_;
+ NotificationRegistrar registrar_;
+
+ // A list of colors which we should use for drawing the popup. These change
+ // between gtk and normal mode.
+ GdkColor border_color_;
+ GdkColor background_color_;
+ GdkColor selected_background_color_;
+ GdkColor hovered_background_color_;
+ GdkColor content_text_color_;
+ GdkColor selected_content_text_color_;
+ GdkColor url_text_color_;
+ GdkColor url_selected_text_color_;
+ GdkColor description_text_color_;
+ GdkColor description_selected_text_color_;
+
// If the user cancels a dragging action (i.e. by pressing ESC), we don't have
// a convenient way to release mouse capture. Instead we use this flag to
// simply ignore all remaining drag events, and the eventual mouse release