Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(107)

Side by Side Diff: chrome/browser/ui/views/frame/browser_view.h

Issue 63173016: DevTools: place DevTools WebContents underneath inspected WebContents. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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_VIEWS_FRAME_BROWSER_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
7 7
8 #include <map> 8 #include <map>
9 #include <string> 9 #include <string>
10 #include <vector> 10 #include <vector>
(...skipping 28 matching lines...) Expand all
39 #include "chrome/browser/hang_monitor/hung_window_detector.h" 39 #include "chrome/browser/hang_monitor/hung_window_detector.h"
40 #endif 40 #endif
41 41
42 // NOTE: For more information about the objects and files in this directory, 42 // NOTE: For more information about the objects and files in this directory,
43 // view: http://dev.chromium.org/developers/design-documents/browser-window 43 // view: http://dev.chromium.org/developers/design-documents/browser-window
44 44
45 class BookmarkBarView; 45 class BookmarkBarView;
46 class Browser; 46 class Browser;
47 class BrowserViewLayout; 47 class BrowserViewLayout;
48 class ContentsContainer; 48 class ContentsContainer;
49 class DevToolsContainer;
49 class DownloadShelfView; 50 class DownloadShelfView;
50 class FullscreenExitBubbleViews; 51 class FullscreenExitBubbleViews;
51 class InfoBarContainerView; 52 class InfoBarContainerView;
52 class LocationBarView; 53 class LocationBarView;
53 class StatusBubbleViews; 54 class StatusBubbleViews;
54 class SearchViewController; 55 class SearchViewController;
55 class TabStrip; 56 class TabStrip;
56 class TabStripModel; 57 class TabStripModel;
57 class ToolbarView; 58 class ToolbarView;
58 class TopContainerView; 59 class TopContainerView;
(...skipping 390 matching lines...) Expand 10 before | Expand all | Expand 10 after
449 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE; 450 virtual void ChildPreferredSizeChanged(View* child) OVERRIDE;
450 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE; 451 virtual void GetAccessibleState(ui::AccessibleViewState* state) OVERRIDE;
451 452
452 // Overridden from ui::AcceleratorTarget: 453 // Overridden from ui::AcceleratorTarget:
453 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE; 454 virtual bool AcceleratorPressed(const ui::Accelerator& accelerator) OVERRIDE;
454 455
455 // OmniboxPopupModelObserver overrides 456 // OmniboxPopupModelObserver overrides
456 virtual void OnOmniboxPopupShownOrHidden() OVERRIDE; 457 virtual void OnOmniboxPopupShownOrHidden() OVERRIDE;
457 458
458 // Testing interface: 459 // Testing interface:
459 views::SingleSplitView* GetContentsSplitForTest() { return contents_split_; }
460 ContentsContainer* GetContentsContainerForTest() { 460 ContentsContainer* GetContentsContainerForTest() {
461 return contents_container_; 461 return contents_container_;
462 } 462 }
463 DevToolsContainer* GetDevToolsContainerForTest() {
464 return devtools_container_;
465 }
463 views::WebView* GetContentsWebViewForTest() { return contents_web_view_; } 466 views::WebView* GetContentsWebViewForTest() { return contents_web_view_; }
464 467
465 private: 468 private:
466 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate 469 // Do not friend BrowserViewLayout. Use the BrowserViewLayoutDelegate
467 // interface to keep these two classes decoupled and testable. 470 // interface to keep these two classes decoupled and testable.
468 friend class BrowserViewLayoutDelegateImpl; 471 friend class BrowserViewLayoutDelegateImpl;
469 FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, BrowserView); 472 FRIEND_TEST_ALL_PREFIXES(BrowserViewTest, BrowserView);
470 FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest, 473 FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest,
471 TestAboutChromeViewAccObj); 474 TestAboutChromeViewAccObj);
472 475
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
511 // type, and there should be a subsequent re-layout to show it. 514 // type, and there should be a subsequent re-layout to show it.
512 // |contents| can be NULL. 515 // |contents| can be NULL.
513 bool MaybeShowInfoBar(content::WebContents* contents); 516 bool MaybeShowInfoBar(content::WebContents* contents);
514 517
515 // Updates devtools window for given contents. This method will show docked 518 // Updates devtools window for given contents. This method will show docked
516 // devtools window for inspected |web_contents| that has docked devtools 519 // devtools window for inspected |web_contents| that has docked devtools
517 // and hide it for NULL or not inspected |web_contents|. It will also make 520 // and hide it for NULL or not inspected |web_contents|. It will also make
518 // sure devtools window size and position are restored for given tab. 521 // sure devtools window size and position are restored for given tab.
519 void UpdateDevToolsForContents(content::WebContents* web_contents); 522 void UpdateDevToolsForContents(content::WebContents* web_contents);
520 523
521 // Shows docked devtools.
522 void ShowDevToolsContainer();
523
524 // Hides docked devtools.
525 void HideDevToolsContainer();
526
527 // Reads split position from the current tab's devtools window and applies
528 // it to the devtools split.
529 void UpdateDevToolsSplitPosition();
530
531 // Updates various optional child Views, e.g. Bookmarks Bar, Info Bar or the 524 // Updates various optional child Views, e.g. Bookmarks Bar, Info Bar or the
532 // Download Shelf in response to a change notification from the specified 525 // Download Shelf in response to a change notification from the specified
533 // |contents|. |contents| can be NULL. In this case, all optional UI will be 526 // |contents|. |contents| can be NULL. In this case, all optional UI will be
534 // removed. 527 // removed.
535 void UpdateUIForContents(content::WebContents* contents); 528 void UpdateUIForContents(content::WebContents* contents);
536 529
537 // Invoked to update the necessary things when our fullscreen state changes 530 // Invoked to update the necessary things when our fullscreen state changes
538 // to |fullscreen|. On Windows this is invoked immediately when we toggle the 531 // to |fullscreen|. On Windows this is invoked immediately when we toggle the
539 // full screen state. On Linux changing the fullscreen state is async, so we 532 // full screen state. On Linux changing the fullscreen state is async, so we
540 // ask the window to change its fullscreen state, then when we get 533 // ask the window to change its fullscreen state, then when we get
(...skipping 63 matching lines...) Expand 10 before | Expand all | Expand 10 after
604 // | -------------------------------------------------------------- | 597 // | -------------------------------------------------------------- |
605 // | | Tabs (tabstrip_) | | 598 // | | Tabs (tabstrip_) | |
606 // | |------------------------------------------------------------| | 599 // | |------------------------------------------------------------| |
607 // | | Navigation buttons, address bar, menu (toolbar_) | | 600 // | | Navigation buttons, address bar, menu (toolbar_) | |
608 // | -------------------------------------------------------------- | 601 // | -------------------------------------------------------------- |
609 // |------------------------------------------------------------------| 602 // |------------------------------------------------------------------|
610 // | All infobars (infobar_container_) [1] | 603 // | All infobars (infobar_container_) [1] |
611 // |------------------------------------------------------------------| 604 // |------------------------------------------------------------------|
612 // | Bookmarks (bookmark_bar_view_) [1] | 605 // | Bookmarks (bookmark_bar_view_) [1] |
613 // |------------------------------------------------------------------| 606 // |------------------------------------------------------------------|
614 // | Debugger splitter (contents_split_) | 607 // | Contents (contents_container_) |
615 // | -------------------------------------------------------------- | 608 // | -------------------------------------------------------------- |
616 // | | Page content (contents_container_) | | 609 // | | DevTools container (devtools_container_) | |
617 // | | -------------------------------------------------------- | | 610 // | | -------------------------------------------------------- | |
618 // | | | contents_web_view_ | | | 611 // | | | contents_web_view_ | | |
619 // | | -------------------------------------------------------- | | 612 // | | -------------------------------------------------------- | |
620 // | -------------------------------------------------------------- | 613 // | | | devtools_web_view_ | | |
621 // | -------------------------------------------------------------- | 614 // | | -------------------------------------------------------- | |
622 // | | Debugger (devtools_container_) | |
623 // | | | |
624 // | -------------------------------------------------------------- | 615 // | -------------------------------------------------------------- |
625 // |------------------------------------------------------------------| 616 // |------------------------------------------------------------------|
626 // | Active downloads (download_shelf_) | 617 // | Active downloads (download_shelf_) |
627 // -------------------------------------------------------------------- 618 // --------------------------------------------------------------------
628 // 619 //
629 // [1] The bookmark bar and info bar are swapped when on the new tab page. 620 // [1] The bookmark bar and info bar are swapped when on the new tab page.
630 // Additionally when the bookmark bar is detached, contents_container_ is 621 // Additionally when the bookmark bar is detached, contents_container_ is
631 // positioned on top of the bar while the tab's contents are placed below 622 // positioned on top of the bar while the tab's contents are placed below
632 // the bar. This allows the find bar to always align with the top of 623 // the bar. This allows the find bar to always align with the top of
633 // contents_container_ regardless if there's bookmark or info bars. 624 // contents_container_ regardless if there's bookmark or info bars.
(...skipping 26 matching lines...) Expand all
660 // The download shelf view (view at the bottom of the page). 651 // The download shelf view (view at the bottom of the page).
661 scoped_ptr<DownloadShelfView> download_shelf_; 652 scoped_ptr<DownloadShelfView> download_shelf_;
662 653
663 // The InfoBarContainerView that contains InfoBars for the current tab. 654 // The InfoBarContainerView that contains InfoBars for the current tab.
664 InfoBarContainerView* infobar_container_; 655 InfoBarContainerView* infobar_container_;
665 656
666 // The view that contains the selected WebContents. 657 // The view that contains the selected WebContents.
667 views::WebView* contents_web_view_; 658 views::WebView* contents_web_view_;
668 659
669 // The view that contains devtools window for the selected WebContents. 660 // The view that contains devtools window for the selected WebContents.
670 views::WebView* devtools_container_; 661 views::WebView* devtools_web_view_;
671 662
672 // The view managing the |contents_web_view_|. 663 // The view managing devtools and contents windows relative positions.
664 DevToolsContainer* devtools_container_;
665
666 // The view managing the |devtools_container_|.
673 ContentsContainer* contents_container_; 667 ContentsContainer* contents_container_;
674 668
675 // Split view containing the contents container and devtools container.
676 views::SingleSplitView* contents_split_;
677
678 // Side to dock devtools to.
679 DevToolsDockSide devtools_dock_side_;
680
681 // Docked devtools window instance. NULL when current tab is not inspected 669 // Docked devtools window instance. NULL when current tab is not inspected
682 // or is inspected with undocked version of DevToolsWindow. 670 // or is inspected with undocked version of DevToolsWindow.
683 DevToolsWindow* devtools_window_; 671 DevToolsWindow* devtools_window_;
684 672
685 // Tracks and stores the last focused view which is not the 673 // Tracks and stores the last focused view which is not the
686 // devtools_container_ or any of its children. Used to restore focus once 674 // devtools_web_view_ or any of its children. Used to restore focus once
687 // the devtools_container_ is hidden. 675 // the devtools_web_view_ is hidden.
688 scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_; 676 scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_;
689 677
690 // The Status information bubble that appears at the bottom of the window. 678 // The Status information bubble that appears at the bottom of the window.
691 scoped_ptr<StatusBubbleViews> status_bubble_; 679 scoped_ptr<StatusBubbleViews> status_bubble_;
692 680
693 // A mapping between accelerators and commands. 681 // A mapping between accelerators and commands.
694 std::map<ui::Accelerator, int> accelerator_table_; 682 std::map<ui::Accelerator, int> accelerator_table_;
695 683
696 // True if we have already been initialized. 684 // True if we have already been initialized.
697 bool initialized_; 685 bool initialized_;
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
741 scoped_ptr<ScrollEndEffectController> scroll_end_effect_controller_; 729 scoped_ptr<ScrollEndEffectController> scroll_end_effect_controller_;
742 730
743 gfx::ScopedSysColorChangeListener color_change_listener_; 731 gfx::ScopedSysColorChangeListener color_change_listener_;
744 732
745 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; 733 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_;
746 734
747 DISALLOW_COPY_AND_ASSIGN(BrowserView); 735 DISALLOW_COPY_AND_ASSIGN(BrowserView);
748 }; 736 };
749 737
750 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ 738 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698