OLD | NEW |
1 // Copyright 2012 The Chromium Authors. All rights reserved. | 1 // Copyright 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_BROWSER_WINDOW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ |
7 | 7 |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 | 11 |
12 #include "base/basictypes.h" | 12 #include "base/basictypes.h" |
13 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
14 #include "base/memory/scoped_ptr.h" | 14 #include "base/memory/scoped_ptr.h" |
15 #include "base/prefs/pref_member.h" | 15 #include "base/prefs/pref_member.h" |
16 #include "base/timer/timer.h" | 16 #include "base/timer/timer.h" |
17 #include "build/build_config.h" | 17 #include "build/build_config.h" |
18 #include "chrome/browser/devtools/devtools_window.h" | 18 #include "chrome/browser/devtools/devtools_window.h" |
19 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 19 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
20 #include "chrome/browser/infobars/infobar_container.h" | 20 #include "chrome/browser/infobars/infobar_container.h" |
21 #include "chrome/browser/ui/browser_window.h" | 21 #include "chrome/browser/ui/browser_window.h" |
22 #include "chrome/browser/ui/host_desktop.h" | 22 #include "chrome/browser/ui/host_desktop.h" |
23 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 23 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 24 #include "ui/base/gtk/gtk_floating_container.h" |
24 #include "ui/base/gtk/gtk_signal.h" | 25 #include "ui/base/gtk/gtk_signal.h" |
25 #include "ui/base/ui_base_types.h" | 26 #include "ui/base/ui_base_types.h" |
26 #include "ui/base/x/active_window_watcher_x_observer.h" | 27 #include "ui/base/x/active_window_watcher_x_observer.h" |
27 #include "ui/base/x/x11_util.h" | 28 #include "ui/base/x/x11_util.h" |
28 #include "ui/gfx/rect.h" | 29 #include "ui/gfx/rect.h" |
29 | 30 |
30 class BookmarkBarGtk; | 31 class BookmarkBarGtk; |
31 class Browser; | 32 class Browser; |
32 class BrowserTitlebar; | 33 class BrowserTitlebar; |
33 class BrowserToolbarGtk; | 34 class BrowserToolbarGtk; |
(...skipping 425 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
459 // and hide it for NULL or not inspected |contents|. It will also make | 460 // and hide it for NULL or not inspected |contents|. It will also make |
460 // sure devtools window size and position are restored for given tab. | 461 // sure devtools window size and position are restored for given tab. |
461 void UpdateDevToolsForContents(content::WebContents* contents); | 462 void UpdateDevToolsForContents(content::WebContents* contents); |
462 | 463 |
463 // Shows docked devtools. | 464 // Shows docked devtools. |
464 void ShowDevToolsContainer(); | 465 void ShowDevToolsContainer(); |
465 | 466 |
466 // Hides docked devtools. | 467 // Hides docked devtools. |
467 void HideDevToolsContainer(); | 468 void HideDevToolsContainer(); |
468 | 469 |
469 // Reads split position from the current tab's devtools window and applies | |
470 // it to the devtools split. | |
471 void UpdateDevToolsSplitPosition(); | |
472 | |
473 // Called when the preference changes. | 470 // Called when the preference changes. |
474 void OnUseCustomChromeFrameChanged(); | 471 void OnUseCustomChromeFrameChanged(); |
475 | 472 |
476 // Determine whether we use should default to native decorations or the custom | 473 // Determine whether we use should default to native decorations or the custom |
477 // frame based on the currently-running window manager. | 474 // frame based on the currently-running window manager. |
478 static bool GetCustomFramePrefDefault(); | 475 static bool GetCustomFramePrefDefault(); |
479 | 476 |
| 477 // Handler for |devtools_floating_container_|'s "set-floating-position" |
| 478 // signal. |
| 479 static void OnDevToolsContainerSetFloatingPosition( |
| 480 GtkFloatingContainer* container, GtkAllocation* allocation, |
| 481 BrowserWindowGtk* browser_window); |
| 482 |
480 // The position and size of the current window. | 483 // The position and size of the current window. |
481 gfx::Rect bounds_; | 484 gfx::Rect bounds_; |
482 | 485 |
483 // The configure bounds of the current window, used to figure out whether to | 486 // The configure bounds of the current window, used to figure out whether to |
484 // ignore later configure events. See OnConfigure() for more information. | 487 // ignore later configure events. See OnConfigure() for more information. |
485 gfx::Rect configure_bounds_; | 488 gfx::Rect configure_bounds_; |
486 | 489 |
487 // The position and size of the non-maximized, non-fullscreen window. | 490 // The position and size of the non-maximized, non-fullscreen window. |
488 gfx::Rect restored_bounds_; | 491 gfx::Rect restored_bounds_; |
489 | 492 |
(...skipping 26 matching lines...) Expand all Loading... |
516 | 519 |
517 // A container that manages the GtkWidget*s of developer tools for the | 520 // A container that manages the GtkWidget*s of developer tools for the |
518 // selected tab contents. | 521 // selected tab contents. |
519 scoped_ptr<TabContentsContainerGtk> devtools_container_; | 522 scoped_ptr<TabContentsContainerGtk> devtools_container_; |
520 | 523 |
521 // The Extension Keybinding Registry responsible for registering listeners for | 524 // The Extension Keybinding Registry responsible for registering listeners for |
522 // accelerators that are sent to the window, that are destined to be turned | 525 // accelerators that are sent to the window, that are destined to be turned |
523 // into events and sent to the extension. | 526 // into events and sent to the extension. |
524 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; | 527 scoped_ptr<ExtensionKeybindingRegistryGtk> extension_keybinding_registry_; |
525 | 528 |
526 DevToolsDockSide devtools_dock_side_; | |
527 | |
528 // Docked devtools window instance. NULL when current tab is not inspected | 529 // Docked devtools window instance. NULL when current tab is not inspected |
529 // or is inspected with undocked version of DevToolsWindow. | 530 // or is inspected with undocked version of DevToolsWindow. |
530 DevToolsWindow* devtools_window_; | 531 DevToolsWindow* devtools_window_; |
531 | 532 |
532 // Split pane containing the contents_container_ and the devtools_container_. | 533 // Insets from the sides of devtools_floating_container_ to the sides of |
533 // Owned by contents_vsplit_. | 534 // contents_container_. Non-zero only if docked devtools is visible. |
534 GtkWidget* contents_hsplit_; | 535 gfx::Insets contents_insets_; |
535 | 536 |
536 // Split pane containing the contents_hsplit_ and the devtools_container_. | 537 // Floating container for devtools_container_ and contents_container_. |
537 // Owned by render_area_vbox_. | 538 // Owned by render_area_vbox_. |
538 GtkWidget* contents_vsplit_; | 539 GtkWidget* devtools_floating_container_; |
539 | 540 |
540 // The tab strip. Always non-NULL. | 541 // The tab strip. Always non-NULL. |
541 scoped_ptr<TabStripGtk> tabstrip_; | 542 scoped_ptr<TabStripGtk> tabstrip_; |
542 | 543 |
543 // The container for info bars. Always non-NULL. | 544 // The container for info bars. Always non-NULL. |
544 scoped_ptr<InfoBarContainerGtk> infobar_container_; | 545 scoped_ptr<InfoBarContainerGtk> infobar_container_; |
545 | 546 |
546 // The timer used to update frames for the Loading Animation. | 547 // The timer used to update frames for the Loading Animation. |
547 base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_; | 548 base::RepeatingTimer<BrowserWindowGtk> loading_animation_timer_; |
548 | 549 |
(...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
582 bool is_fullscreen_; | 583 bool is_fullscreen_; |
583 | 584 |
584 scoped_ptr<FullscreenExitBubbleGtk> fullscreen_exit_bubble_; | 585 scoped_ptr<FullscreenExitBubbleGtk> fullscreen_exit_bubble_; |
585 | 586 |
586 content::NotificationRegistrar registrar_; | 587 content::NotificationRegistrar registrar_; |
587 | 588 |
588 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); | 589 DISALLOW_COPY_AND_ASSIGN(BrowserWindowGtk); |
589 }; | 590 }; |
590 | 591 |
591 #endif // CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ | 592 #endif // CHROME_BROWSER_UI_GTK_BROWSER_WINDOW_GTK_H_ |
OLD | NEW |