| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 <map> | 10 #include <map> |
| (...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 virtual int PageActionVisibleCount(); | 113 virtual int PageActionVisibleCount(); |
| 114 virtual ExtensionAction* GetPageAction(size_t index); | 114 virtual ExtensionAction* GetPageAction(size_t index); |
| 115 virtual ExtensionAction* GetVisiblePageAction(size_t index); | 115 virtual ExtensionAction* GetVisiblePageAction(size_t index); |
| 116 virtual void TestPageActionPressed(size_t index); | 116 virtual void TestPageActionPressed(size_t index); |
| 117 | 117 |
| 118 // Implement the NotificationObserver interface. | 118 // Implement the NotificationObserver interface. |
| 119 virtual void Observe(NotificationType type, | 119 virtual void Observe(NotificationType type, |
| 120 const NotificationSource& source, | 120 const NotificationSource& source, |
| 121 const NotificationDetails& details); | 121 const NotificationDetails& details); |
| 122 | 122 |
| 123 // Translation between a security level and the background color. Both the | 123 // Edit background color. |
| 124 // location bar and edit have to manage and match the background color. | 124 static const GdkColor kBackgroundColor; |
| 125 static const GdkColor kBackgroundColorByLevel[3]; | |
| 126 | 125 |
| 127 private: | 126 private: |
| 128 class ContentSettingImageViewGtk : public InfoBubbleGtkDelegate { | 127 class ContentSettingImageViewGtk : public InfoBubbleGtkDelegate { |
| 129 public: | 128 public: |
| 130 ContentSettingImageViewGtk(ContentSettingsType content_type, | 129 ContentSettingImageViewGtk(ContentSettingsType content_type, |
| 131 const LocationBarViewGtk* parent, | 130 const LocationBarViewGtk* parent, |
| 132 Profile* profile); | 131 Profile* profile); |
| 133 virtual ~ContentSettingImageViewGtk(); | 132 virtual ~ContentSettingImageViewGtk(); |
| 134 | 133 |
| 135 GtkWidget* widget() { return event_box_.get(); } | 134 GtkWidget* widget() { return event_box_.get(); } |
| (...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 269 HandleExpose(widget, event); | 268 HandleExpose(widget, event); |
| 270 } | 269 } |
| 271 | 270 |
| 272 gboolean HandleExpose(GtkWidget* widget, GdkEventExpose* event); | 271 gboolean HandleExpose(GtkWidget* widget, GdkEventExpose* event); |
| 273 | 272 |
| 274 static gboolean OnSecurityIconPressed(GtkWidget* sender, | 273 static gboolean OnSecurityIconPressed(GtkWidget* sender, |
| 275 GdkEventButton* event, | 274 GdkEventButton* event, |
| 276 LocationBarViewGtk* location_bar); | 275 LocationBarViewGtk* location_bar); |
| 277 | 276 |
| 278 // Set the SSL icon we should be showing. | 277 // Set the SSL icon we should be showing. |
| 279 void SetSecurityIcon(ToolbarModel::Icon icon); | 278 void SetSecurityIcon(int resource_id); |
| 280 | 279 |
| 281 // Sets the text that should be displayed in the info label and its associated | 280 // Sets the text that should be displayed in the info label and its associated |
| 282 // tooltip text. Call with an empty string if the info label should be | 281 // tooltip text. Call with an empty string if the info label should be |
| 283 // hidden. | 282 // hidden. |
| 284 void SetInfoText(); | 283 void SetInfoText(); |
| 285 | 284 |
| 286 // Set the keyword text for the Search BLAH: keyword box. | 285 // Set the keyword text for the Search BLAH: keyword box. |
| 287 void SetKeywordLabel(const std::wstring& keyword); | 286 void SetKeywordLabel(const std::wstring& keyword); |
| 288 | 287 |
| 289 // Set the keyword text for the "Press tab to search BLAH" hint box. | 288 // Set the keyword text for the "Press tab to search BLAH" hint box. |
| (...skipping 11 matching lines...) Expand all Loading... |
| 301 | 300 |
| 302 // Show or hide |tab_to_search_box_|, |tab_to_search_hint_| and | 301 // Show or hide |tab_to_search_box_|, |tab_to_search_hint_| and |
| 303 // |type_to_search_hint_| according to the value of |show_selected_keyword_|, | 302 // |type_to_search_hint_| according to the value of |show_selected_keyword_|, |
| 304 // |show_keyword_hint_|, |show_search_hint_| and the available horizontal | 303 // |show_keyword_hint_|, |show_search_hint_| and the available horizontal |
| 305 // space in the location bar. | 304 // space in the location bar. |
| 306 void AdjustChildrenVisibility(); | 305 void AdjustChildrenVisibility(); |
| 307 | 306 |
| 308 // The outermost widget we want to be hosted. | 307 // The outermost widget we want to be hosted. |
| 309 OwnedWidgetGtk hbox_; | 308 OwnedWidgetGtk hbox_; |
| 310 | 309 |
| 311 // SSL icons. | 310 // SSL state. |
| 312 GtkWidget* security_icon_event_box_; | 311 GtkWidget* security_icon_event_box_; |
| 313 GtkWidget* security_lock_icon_image_; | 312 GtkWidget* ev_secure_icon_image_; |
| 313 GtkWidget* secure_icon_image_; |
| 314 GtkWidget* security_warning_icon_image_; | 314 GtkWidget* security_warning_icon_image_; |
| 315 // Toolbar info text (EV cert info). | 315 GtkWidget* security_error_icon_image_; |
| 316 GtkWidget* info_label_; | 316 GtkWidget* security_info_label_; |
| 317 | 317 |
| 318 // Content setting icons. | 318 // Content setting icons. |
| 319 OwnedWidgetGtk content_setting_hbox_; | 319 OwnedWidgetGtk content_setting_hbox_; |
| 320 ScopedVector<ContentSettingImageViewGtk> content_setting_views_; | 320 ScopedVector<ContentSettingImageViewGtk> content_setting_views_; |
| 321 | 321 |
| 322 // Extension page action icons. | 322 // Extension page action icons. |
| 323 OwnedWidgetGtk page_action_hbox_; | 323 OwnedWidgetGtk page_action_hbox_; |
| 324 ScopedVector<PageActionViewGtk> page_action_views_; | 324 ScopedVector<PageActionViewGtk> page_action_views_; |
| 325 | 325 |
| 326 // Area on the left shown when in tab to search mode. | 326 // Area on the left shown when in tab to search mode. |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 380 // Indicate if |tab_to_search_hint_| should be shown. | 380 // Indicate if |tab_to_search_hint_| should be shown. |
| 381 bool show_keyword_hint_; | 381 bool show_keyword_hint_; |
| 382 | 382 |
| 383 // Indicate if |type_to_search_hint_| should be shown. | 383 // Indicate if |type_to_search_hint_| should be shown. |
| 384 bool show_search_hint_; | 384 bool show_search_hint_; |
| 385 | 385 |
| 386 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 386 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
| 387 }; | 387 }; |
| 388 | 388 |
| 389 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ | 389 #endif // CHROME_BROWSER_GTK_LOCATION_BAR_VIEW_GTK_H_ |
| OLD | NEW |