| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| 6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| 7 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
| 10 | 10 |
| 11 #include <map> | 11 #include <map> |
| 12 #include <string> | 12 #include <string> |
| 13 | 13 |
| 14 #include "base/basictypes.h" | 14 #include "base/basictypes.h" |
| 15 #include "base/compiler_specific.h" | 15 #include "base/compiler_specific.h" |
| 16 #include "base/memory/scoped_ptr.h" | 16 #include "base/memory/scoped_ptr.h" |
| 17 #include "base/memory/scoped_vector.h" | 17 #include "base/memory/scoped_vector.h" |
| 18 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 18 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 19 #include "chrome/browser/extensions/extension_context_menu_model.h" | 19 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 20 #include "chrome/browser/extensions/image_loading_tracker.h" | 20 #include "chrome/browser/extensions/image_loading_tracker.h" |
| 21 #include "chrome/browser/first_run/first_run.h" | 21 #include "chrome/browser/first_run/first_run.h" |
| 22 #include "chrome/browser/prefs/pref_member.h" | 22 #include "chrome/browser/prefs/pref_member.h" |
| 23 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" | 23 #include "chrome/browser/ui/gtk/bubble/bubble_gtk.h" |
| 24 #include "chrome/browser/ui/gtk/menu_gtk.h" | 24 #include "chrome/browser/ui/gtk/menu_gtk.h" |
| 25 #include "chrome/browser/ui/gtk/owned_widget_gtk.h" | |
| 26 #include "chrome/browser/ui/omnibox/location_bar.h" | 25 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 27 #include "chrome/common/content_settings_types.h" | 26 #include "chrome/common/content_settings_types.h" |
| 28 #include "content/common/notification_observer.h" | 27 #include "content/common/notification_observer.h" |
| 29 #include "content/common/notification_registrar.h" | 28 #include "content/common/notification_registrar.h" |
| 30 #include "content/common/page_transition_types.h" | 29 #include "content/common/page_transition_types.h" |
| 31 #include "third_party/skia/include/core/SkBitmap.h" | 30 #include "third_party/skia/include/core/SkBitmap.h" |
| 32 #include "ui/base/animation/animation_delegate.h" | 31 #include "ui/base/animation/animation_delegate.h" |
| 33 #include "ui/base/animation/slide_animation.h" | 32 #include "ui/base/animation/slide_animation.h" |
| 34 #include "ui/base/gtk/gtk_signal.h" | 33 #include "ui/base/gtk/gtk_signal.h" |
| 34 #include "ui/base/gtk/owned_widget_gtk.h" |
| 35 #include "webkit/glue/window_open_disposition.h" | 35 #include "webkit/glue/window_open_disposition.h" |
| 36 | 36 |
| 37 class OmniboxViewGtk; | 37 class OmniboxViewGtk; |
| 38 class Browser; | 38 class Browser; |
| 39 class CommandUpdater; | 39 class CommandUpdater; |
| 40 class ContentSettingImageModel; | 40 class ContentSettingImageModel; |
| 41 class ContentSettingBubbleGtk; | 41 class ContentSettingBubbleGtk; |
| 42 class ExtensionAction; | 42 class ExtensionAction; |
| 43 class GtkThemeService; | 43 class GtkThemeService; |
| 44 class SkBitmap; | 44 class SkBitmap; |
| (...skipping 126 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 171 CHROMEGTK_CALLBACK_1(ContentSettingImageViewGtk, gboolean, OnExpose, | 171 CHROMEGTK_CALLBACK_1(ContentSettingImageViewGtk, gboolean, OnExpose, |
| 172 GdkEventExpose*); | 172 GdkEventExpose*); |
| 173 | 173 |
| 174 // BubbleDelegateGtk overrides: | 174 // BubbleDelegateGtk overrides: |
| 175 virtual void BubbleClosing(BubbleGtk* bubble, | 175 virtual void BubbleClosing(BubbleGtk* bubble, |
| 176 bool closed_by_escape) OVERRIDE; | 176 bool closed_by_escape) OVERRIDE; |
| 177 | 177 |
| 178 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; | 178 scoped_ptr<ContentSettingImageModel> content_setting_image_model_; |
| 179 | 179 |
| 180 // The widgets for this content settings view. | 180 // The widgets for this content settings view. |
| 181 OwnedWidgetGtk alignment_; | 181 ui::OwnedWidgetGtk alignment_; |
| 182 OwnedWidgetGtk event_box_; | 182 ui::OwnedWidgetGtk event_box_; |
| 183 GtkWidget* hbox_; | 183 GtkWidget* hbox_; |
| 184 OwnedWidgetGtk image_; | 184 ui::OwnedWidgetGtk image_; |
| 185 | 185 |
| 186 // Explanatory text ("popup blocked"). | 186 // Explanatory text ("popup blocked"). |
| 187 OwnedWidgetGtk label_; | 187 ui::OwnedWidgetGtk label_; |
| 188 | 188 |
| 189 // The owning LocationBarViewGtk. | 189 // The owning LocationBarViewGtk. |
| 190 const LocationBarViewGtk* parent_; | 190 const LocationBarViewGtk* parent_; |
| 191 | 191 |
| 192 // The currently shown bubble if any. | 192 // The currently shown bubble if any. |
| 193 ContentSettingBubbleGtk* content_setting_bubble_; | 193 ContentSettingBubbleGtk* content_setting_bubble_; |
| 194 | 194 |
| 195 // When we show explanatory text, we slide it in/out. | 195 // When we show explanatory text, we slide it in/out. |
| 196 ui::SlideAnimation animation_; | 196 ui::SlideAnimation animation_; |
| 197 | 197 |
| (...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 // corresponds to it. We keep track of both so we can free old pixbufs as | 259 // corresponds to it. We keep track of both so we can free old pixbufs as |
| 260 // their icons are replaced. | 260 // their icons are replaced. |
| 261 SkBitmap last_icon_skbitmap_; | 261 SkBitmap last_icon_skbitmap_; |
| 262 GdkPixbuf* last_icon_pixbuf_; | 262 GdkPixbuf* last_icon_pixbuf_; |
| 263 | 263 |
| 264 // The object that is waiting for the image loading to complete | 264 // The object that is waiting for the image loading to complete |
| 265 // asynchronously. | 265 // asynchronously. |
| 266 ImageLoadingTracker tracker_; | 266 ImageLoadingTracker tracker_; |
| 267 | 267 |
| 268 // The widgets for this page action. | 268 // The widgets for this page action. |
| 269 OwnedWidgetGtk event_box_; | 269 ui::OwnedWidgetGtk event_box_; |
| 270 OwnedWidgetGtk image_; | 270 ui::OwnedWidgetGtk image_; |
| 271 | 271 |
| 272 // The tab id we are currently showing the icon for. | 272 // The tab id we are currently showing the icon for. |
| 273 int current_tab_id_; | 273 int current_tab_id_; |
| 274 | 274 |
| 275 // The URL we are currently showing the icon for. | 275 // The URL we are currently showing the icon for. |
| 276 GURL current_url_; | 276 GURL current_url_; |
| 277 | 277 |
| 278 // This is used for post-install visual feedback. The page_action icon | 278 // This is used for post-install visual feedback. The page_action icon |
| 279 // is briefly shown even if it hasn't been enabled by its extension. | 279 // is briefly shown even if it hasn't been enabled by its extension. |
| 280 bool preview_enabled_; | 280 bool preview_enabled_; |
| (...skipping 62 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 343 void CreateStarButton(); | 343 void CreateStarButton(); |
| 344 | 344 |
| 345 // Update the star icon after it is toggled or the theme changes. | 345 // Update the star icon after it is toggled or the theme changes. |
| 346 void UpdateStarIcon(); | 346 void UpdateStarIcon(); |
| 347 | 347 |
| 348 // Returns true if we should only show the URL and none of the extras like | 348 // Returns true if we should only show the URL and none of the extras like |
| 349 // the star button or page actions. | 349 // the star button or page actions. |
| 350 bool ShouldOnlyShowLocation(); | 350 bool ShouldOnlyShowLocation(); |
| 351 | 351 |
| 352 // The outermost widget we want to be hosted. | 352 // The outermost widget we want to be hosted. |
| 353 OwnedWidgetGtk hbox_; | 353 ui::OwnedWidgetGtk hbox_; |
| 354 | 354 |
| 355 // Star button. | 355 // Star button. |
| 356 OwnedWidgetGtk star_; | 356 ui::OwnedWidgetGtk star_; |
| 357 GtkWidget* star_image_; | 357 GtkWidget* star_image_; |
| 358 bool starred_; | 358 bool starred_; |
| 359 | 359 |
| 360 // An icon to the left of the address bar. | 360 // An icon to the left of the address bar. |
| 361 GtkWidget* site_type_alignment_; | 361 GtkWidget* site_type_alignment_; |
| 362 GtkWidget* site_type_event_box_; | 362 GtkWidget* site_type_event_box_; |
| 363 GtkWidget* location_icon_image_; | 363 GtkWidget* location_icon_image_; |
| 364 GtkWidget* drag_icon_; | 364 GtkWidget* drag_icon_; |
| 365 bool enable_location_drag_; | 365 bool enable_location_drag_; |
| 366 // TODO(pkasting): Split this label off and move the rest of the items to the | 366 // TODO(pkasting): Split this label off and move the rest of the items to the |
| 367 // left of the address bar. | 367 // left of the address bar. |
| 368 GtkWidget* security_info_label_; | 368 GtkWidget* security_info_label_; |
| 369 | 369 |
| 370 // Content setting icons. | 370 // Content setting icons. |
| 371 OwnedWidgetGtk content_setting_hbox_; | 371 ui::OwnedWidgetGtk content_setting_hbox_; |
| 372 ScopedVector<ContentSettingImageViewGtk> content_setting_views_; | 372 ScopedVector<ContentSettingImageViewGtk> content_setting_views_; |
| 373 | 373 |
| 374 // Extension page action icons. | 374 // Extension page action icons. |
| 375 OwnedWidgetGtk page_action_hbox_; | 375 ui::OwnedWidgetGtk page_action_hbox_; |
| 376 ScopedVector<PageActionViewGtk> page_action_views_; | 376 ScopedVector<PageActionViewGtk> page_action_views_; |
| 377 | 377 |
| 378 // The widget that contains our tab hints and the location bar. | 378 // The widget that contains our tab hints and the location bar. |
| 379 GtkWidget* entry_box_; | 379 GtkWidget* entry_box_; |
| 380 | 380 |
| 381 // Area on the left shown when in tab to search mode. | 381 // Area on the left shown when in tab to search mode. |
| 382 GtkWidget* tab_to_search_alignment_; | 382 GtkWidget* tab_to_search_alignment_; |
| 383 GtkWidget* tab_to_search_box_; | 383 GtkWidget* tab_to_search_box_; |
| 384 GtkWidget* tab_to_search_magnifier_; | 384 GtkWidget* tab_to_search_magnifier_; |
| 385 GtkWidget* tab_to_search_full_label_; | 385 GtkWidget* tab_to_search_full_label_; |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 439 // The last search keyword that was shown via the |tab_to_search_box_|. | 439 // The last search keyword that was shown via the |tab_to_search_box_|. |
| 440 string16 last_keyword_; | 440 string16 last_keyword_; |
| 441 | 441 |
| 442 // Used to change the visibility of the star decoration. | 442 // Used to change the visibility of the star decoration. |
| 443 BooleanPrefMember edit_bookmarks_enabled_; | 443 BooleanPrefMember edit_bookmarks_enabled_; |
| 444 | 444 |
| 445 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 445 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
| 446 }; | 446 }; |
| 447 | 447 |
| 448 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 448 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| OLD | NEW |