| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| 7 | 7 |
| 8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
| 9 | 9 |
| 10 #include <string> | 10 #include <string> |
| (...skipping 10 matching lines...) Expand all Loading... |
| 21 #include "chrome/common/notification_registrar.h" | 21 #include "chrome/common/notification_registrar.h" |
| 22 #include "chrome/common/owned_widget_gtk.h" | 22 #include "chrome/common/owned_widget_gtk.h" |
| 23 #include "chrome/common/page_transition_types.h" | 23 #include "chrome/common/page_transition_types.h" |
| 24 #include "webkit/glue/window_open_disposition.h" | 24 #include "webkit/glue/window_open_disposition.h" |
| 25 | 25 |
| 26 class AutocompleteEditViewGtk; | 26 class AutocompleteEditViewGtk; |
| 27 class BubblePositioner; | 27 class BubblePositioner; |
| 28 class Browser; | 28 class Browser; |
| 29 class CommandUpdater; | 29 class CommandUpdater; |
| 30 class GtkThemeProvider; | 30 class GtkThemeProvider; |
| 31 class PageAction; | 31 class ContextualAction; |
| 32 class Profile; | 32 class Profile; |
| 33 class SkBitmap; | 33 class SkBitmap; |
| 34 class TabContents; | 34 class TabContents; |
| 35 class ToolbarModel; | 35 class ToolbarModel; |
| 36 | 36 |
| 37 class LocationBarViewGtk : public AutocompleteEditController, | 37 class LocationBarViewGtk : public AutocompleteEditController, |
| 38 public LocationBar, | 38 public LocationBar, |
| 39 public LocationBarTesting, | 39 public LocationBarTesting, |
| 40 public NotificationObserver { | 40 public NotificationObserver { |
| 41 public: | 41 public: |
| (...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 97 | 97 |
| 98 // Translation between a security level and the background color. Both the | 98 // Translation between a security level and the background color. Both the |
| 99 // location bar and edit have to manage and match the background color. | 99 // location bar and edit have to manage and match the background color. |
| 100 static const GdkColor kBackgroundColorByLevel[3]; | 100 static const GdkColor kBackgroundColorByLevel[3]; |
| 101 | 101 |
| 102 private: | 102 private: |
| 103 class PageActionViewGtk : public ImageLoadingTracker::Observer { | 103 class PageActionViewGtk : public ImageLoadingTracker::Observer { |
| 104 public: | 104 public: |
| 105 PageActionViewGtk( | 105 PageActionViewGtk( |
| 106 LocationBarViewGtk* owner, Profile* profile, | 106 LocationBarViewGtk* owner, Profile* profile, |
| 107 const PageAction* page_action); | 107 const ContextualAction* page_action); |
| 108 virtual ~PageActionViewGtk(); | 108 virtual ~PageActionViewGtk(); |
| 109 | 109 |
| 110 GtkWidget* widget() { return event_box_.get(); } | 110 GtkWidget* widget() { return event_box_.get(); } |
| 111 | 111 |
| 112 // Called to notify the PageAction that it should determine whether to be | 112 // Called to notify the PageAction that it should determine whether to be |
| 113 // visible or hidden. |contents| is the TabContents that is active, |url| | 113 // visible or hidden. |contents| is the TabContents that is active, |url| |
| 114 // is the current page URL. | 114 // is the current page URL. |
| 115 void UpdateVisibility(TabContents* contents, GURL url); | 115 void UpdateVisibility(TabContents* contents, GURL url); |
| 116 | 116 |
| 117 // A callback from ImageLoadingTracker for when the image has loaded. | 117 // A callback from ImageLoadingTracker for when the image has loaded. |
| 118 virtual void OnImageLoaded(SkBitmap* image, size_t index); | 118 virtual void OnImageLoaded(SkBitmap* image, size_t index); |
| 119 | 119 |
| 120 private: | 120 private: |
| 121 static gboolean OnButtonPressed(GtkWidget* sender, GdkEventButton* event, | 121 static gboolean OnButtonPressed(GtkWidget* sender, GdkEventButton* event, |
| 122 PageActionViewGtk* page_action_view); | 122 PageActionViewGtk* page_action_view); |
| 123 | 123 |
| 124 // The location bar view that owns us. | 124 // The location bar view that owns us. |
| 125 LocationBarViewGtk* owner_; | 125 LocationBarViewGtk* owner_; |
| 126 | 126 |
| 127 // The current profile (not owned by us). | 127 // The current profile (not owned by us). |
| 128 Profile* profile_; | 128 Profile* profile_; |
| 129 | 129 |
| 130 // The PageAction that this view represents. The PageAction is not owned by | 130 // The PageAction that this view represents. The PageAction is not owned by |
| 131 // us, it resides in the extension of this particular profile. | 131 // us, it resides in the extension of this particular profile. |
| 132 const PageAction* page_action_; | 132 const ContextualAction* page_action_; |
| 133 | 133 |
| 134 // The icons representing different states for the page action. | 134 // The icons representing different states for the page action. |
| 135 std::vector<GdkPixbuf*> pixbufs_; | 135 std::vector<GdkPixbuf*> pixbufs_; |
| 136 | 136 |
| 137 // The object that is waiting for the image loading to complete | 137 // The object that is waiting for the image loading to complete |
| 138 // asynchronously. It will delete itself once it is done. | 138 // asynchronously. It will delete itself once it is done. |
| 139 ImageLoadingTracker* tracker_; | 139 ImageLoadingTracker* tracker_; |
| 140 | 140 |
| 141 // The widgets for this page action. | 141 // The widgets for this page action. |
| 142 OwnedWidgetGtk event_box_; | 142 OwnedWidgetGtk event_box_; |
| (...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 232 | 232 |
| 233 // Provides colors and rendering mode. | 233 // Provides colors and rendering mode. |
| 234 GtkThemeProvider* theme_provider_; | 234 GtkThemeProvider* theme_provider_; |
| 235 | 235 |
| 236 NotificationRegistrar registrar_; | 236 NotificationRegistrar registrar_; |
| 237 | 237 |
| 238 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 238 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
| 239 }; | 239 }; |
| 240 | 240 |
| 241 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 241 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| OLD | NEW |