OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <map> | 10 #include <map> |
(...skipping 348 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnIconDragBegin, | 359 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnIconDragBegin, |
360 GdkDragContext*); | 360 GdkDragContext*); |
361 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnIconDragEnd, | 361 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnIconDragEnd, |
362 GdkDragContext*); | 362 GdkDragContext*); |
363 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnHboxSizeAllocate, | 363 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnHboxSizeAllocate, |
364 GtkAllocation*); | 364 GtkAllocation*); |
365 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnEntryBoxSizeAllocate, | 365 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnEntryBoxSizeAllocate, |
366 GtkAllocation*); | 366 GtkAllocation*); |
367 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, gboolean, OnZoomButtonPress, | 367 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, gboolean, OnZoomButtonPress, |
368 GdkEventButton*); | 368 GdkEventButton*); |
| 369 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, gboolean, OnScriptBubbleButtonPress, |
| 370 GdkEventButton*); |
369 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnStarButtonSizeAllocate, | 371 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, void, OnStarButtonSizeAllocate, |
370 GtkAllocation*); | 372 GtkAllocation*); |
371 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, gboolean, OnStarButtonPress, | 373 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, gboolean, OnStarButtonPress, |
372 GdkEventButton*); | 374 GdkEventButton*); |
| 375 CHROMEGTK_CALLBACK_1(LocationBarViewGtk, gboolean, |
| 376 OnScriptBubbleButtonExpose, GdkEventExpose*); |
373 | 377 |
374 // Updates the site type area: changes the icon and shows/hides the EV | 378 // Updates the site type area: changes the icon and shows/hides the EV |
375 // certificate information. | 379 // certificate information. |
376 void UpdateSiteTypeArea(); | 380 void UpdateSiteTypeArea(); |
377 | 381 |
378 // Updates the maximum size of the EV certificate label. | 382 // Updates the maximum size of the EV certificate label. |
379 void UpdateEVCertificateLabelSize(); | 383 void UpdateEVCertificateLabelSize(); |
380 | 384 |
381 // Sets the text that should be displayed in the info label and its associated | 385 // Sets the text that should be displayed in the info label and its associated |
382 // tooltip text. Call with an empty string if the info label should be | 386 // tooltip text. Call with an empty string if the info label should be |
383 // hidden. | 387 // hidden. |
384 void SetInfoText(); | 388 void SetInfoText(); |
385 | 389 |
386 // Set the keyword text for the Search BLAH: keyword box. | 390 // Set the keyword text for the Search BLAH: keyword box. |
387 void SetKeywordLabel(const string16& keyword); | 391 void SetKeywordLabel(const string16& keyword); |
388 | 392 |
389 // Set the keyword text for the "Press tab to search BLAH" hint box. | 393 // Set the keyword text for the "Press tab to search BLAH" hint box. |
390 void SetKeywordHintLabel(const string16& keyword); | 394 void SetKeywordHintLabel(const string16& keyword); |
391 | 395 |
392 void ShowFirstRunBubbleInternal(); | 396 void ShowFirstRunBubbleInternal(); |
393 | 397 |
394 // Show or hide |tab_to_search_box_| and |tab_to_search_hint_| according to | 398 // Show or hide |tab_to_search_box_| and |tab_to_search_hint_| according to |
395 // the value of |show_selected_keyword_|, |show_keyword_hint_|, and the | 399 // the value of |show_selected_keyword_|, |show_keyword_hint_|, and the |
396 // available horizontal space in the location bar. | 400 // available horizontal space in the location bar. |
397 void AdjustChildrenVisibility(); | 401 void AdjustChildrenVisibility(); |
398 | 402 |
399 // Build the zoom, and star icons. | 403 // Helpers to build create the various buttons that show up in the location |
| 404 // bar. |
400 GtkWidget* CreateIconButton( | 405 GtkWidget* CreateIconButton( |
401 GtkWidget** image, | 406 GtkWidget** image, |
402 int image_id, | 407 int image_id, |
403 ViewID debug_id, | 408 ViewID debug_id, |
404 int tooltip_id, | 409 int tooltip_id, |
405 gboolean (click_callback)(GtkWidget*, GdkEventButton*, gpointer)); | 410 gboolean (click_callback)(GtkWidget*, GdkEventButton*, gpointer)); |
406 void CreateZoomButton(); | 411 void CreateZoomButton(); |
| 412 void CreateScriptBubbleButton(); |
407 void CreateStarButton(); | 413 void CreateStarButton(); |
408 | 414 |
409 // Update the zoom icon after zoom changes. | 415 // Helpers to update state of the various buttons that show up in the |
| 416 // location bar. |
410 void UpdateZoomIcon(); | 417 void UpdateZoomIcon(); |
411 | 418 void UpdateScriptBubbleIcon(); |
412 // Update the star icon after it is toggled or the theme changes. | |
413 void UpdateStarIcon(); | 419 void UpdateStarIcon(); |
414 | 420 |
415 // Returns true if we should only show the URL and none of the extras like | 421 // Returns true if we should only show the URL and none of the extras like |
416 // the star button or page actions. | 422 // the star button or page actions. |
417 bool ShouldOnlyShowLocation(); | 423 bool ShouldOnlyShowLocation(); |
418 | 424 |
419 // The outermost widget we want to be hosted. | 425 // The outermost widget we want to be hosted. |
420 ui::OwnedWidgetGtk hbox_; | 426 ui::OwnedWidgetGtk hbox_; |
421 | 427 |
422 // Zoom button. | 428 // Zoom button. |
423 ui::OwnedWidgetGtk zoom_; | 429 ui::OwnedWidgetGtk zoom_; |
424 GtkWidget* zoom_image_; | 430 GtkWidget* zoom_image_; |
425 | 431 |
| 432 ui::OwnedWidgetGtk script_bubble_button_; |
| 433 GtkWidget* script_bubble_button_image_; |
| 434 size_t num_running_scripts_; |
| 435 |
426 // Star button. | 436 // Star button. |
427 ui::OwnedWidgetGtk star_; | 437 ui::OwnedWidgetGtk star_; |
428 GtkWidget* star_image_; | 438 GtkWidget* star_image_; |
429 bool starred_; | 439 bool starred_; |
430 bool star_sized_; // True after a size-allocate signal to the star widget. | 440 bool star_sized_; // True after a size-allocate signal to the star widget. |
431 | 441 |
432 // Action to execute after the star icon has been sized, can refer to a NULL | 442 // Action to execute after the star icon has been sized, can refer to a NULL |
433 // function to indicate no such action should be taken. | 443 // function to indicate no such action should be taken. |
434 base::Closure on_star_sized_; | 444 base::Closure on_star_sized_; |
435 | 445 |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
528 BooleanPrefMember edit_bookmarks_enabled_; | 538 BooleanPrefMember edit_bookmarks_enabled_; |
529 | 539 |
530 // Used to remember the URL and title text when drag&drop has begun. | 540 // Used to remember the URL and title text when drag&drop has begun. |
531 GURL drag_url_; | 541 GURL drag_url_; |
532 string16 drag_title_; | 542 string16 drag_title_; |
533 | 543 |
534 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 544 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
535 }; | 545 }; |
536 | 546 |
537 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 547 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |