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_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 <memory> |
9 #include <string> | 10 #include <string> |
10 #include <vector> | 11 #include <vector> |
11 | 12 |
12 #include "base/compiler_specific.h" | 13 #include "base/compiler_specific.h" |
13 #include "base/gtest_prod_util.h" | 14 #include "base/gtest_prod_util.h" |
14 #include "base/macros.h" | 15 #include "base/macros.h" |
15 #include "base/memory/scoped_ptr.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_commands_global_registry.h" | 19 #include "chrome/browser/extensions/extension_commands_global_registry.h" |
20 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 20 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
21 #include "chrome/browser/ui/browser.h" | 21 #include "chrome/browser/ui/browser.h" |
22 #include "chrome/browser/ui/browser_window.h" | 22 #include "chrome/browser/ui/browser_window.h" |
23 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" | 23 #include "chrome/browser/ui/exclusive_access/exclusive_access_context.h" |
24 #include "chrome/browser/ui/infobar_container_delegate.h" | 24 #include "chrome/browser/ui/infobar_container_delegate.h" |
25 #include "chrome/browser/ui/signin_view_controller.h" | 25 #include "chrome/browser/ui/signin_view_controller.h" |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
571 // Returns the max top arrow height for infobar. | 571 // Returns the max top arrow height for infobar. |
572 int GetMaxTopInfoBarArrowHeight(); | 572 int GetMaxTopInfoBarArrowHeight(); |
573 | 573 |
574 // Last focused view that issued a tab traversal. | 574 // Last focused view that issued a tab traversal. |
575 int last_focused_view_storage_id_; | 575 int last_focused_view_storage_id_; |
576 | 576 |
577 // The BrowserFrame that hosts this view. | 577 // The BrowserFrame that hosts this view. |
578 BrowserFrame* frame_; | 578 BrowserFrame* frame_; |
579 | 579 |
580 // The Browser object we are associated with. | 580 // The Browser object we are associated with. |
581 scoped_ptr<Browser> browser_; | 581 std::unique_ptr<Browser> browser_; |
582 | 582 |
583 // BrowserView layout (LTR one is pictured here). | 583 // BrowserView layout (LTR one is pictured here). |
584 // | 584 // |
585 // -------------------------------------------------------------------- | 585 // -------------------------------------------------------------------- |
586 // | TopContainerView (top_container_) | | 586 // | TopContainerView (top_container_) | |
587 // | -------------------------------------------------------------- | | 587 // | -------------------------------------------------------------- | |
588 // | | Tabs (tabstrip_) | | | 588 // | | Tabs (tabstrip_) | | |
589 // | |------------------------------------------------------------| | | 589 // | |------------------------------------------------------------| | |
590 // | | Navigation buttons, address bar, menu (toolbar_) | | | 590 // | | Navigation buttons, address bar, menu (toolbar_) | | |
591 // | -------------------------------------------------------------- | | 591 // | -------------------------------------------------------------- | |
(...skipping 24 matching lines...) Expand all Loading... |
616 TopContainerView* top_container_; | 616 TopContainerView* top_container_; |
617 | 617 |
618 // The TabStrip. | 618 // The TabStrip. |
619 TabStrip* tabstrip_; | 619 TabStrip* tabstrip_; |
620 | 620 |
621 // The Toolbar containing the navigation buttons, menus and the address bar. | 621 // The Toolbar containing the navigation buttons, menus and the address bar. |
622 ToolbarView* toolbar_; | 622 ToolbarView* toolbar_; |
623 | 623 |
624 // The Bookmark Bar View for this window. Lazily created. May be null for | 624 // The Bookmark Bar View for this window. Lazily created. May be null for |
625 // non-tabbed browsers like popups. May not be visible. | 625 // non-tabbed browsers like popups. May not be visible. |
626 scoped_ptr<BookmarkBarView> bookmark_bar_view_; | 626 std::unique_ptr<BookmarkBarView> bookmark_bar_view_; |
627 | 627 |
628 // The do-nothing view which controls the z-order of the find bar widget | 628 // The do-nothing view which controls the z-order of the find bar widget |
629 // relative to views which paint into layers and views with an associated | 629 // relative to views which paint into layers and views with an associated |
630 // NativeView. | 630 // NativeView. |
631 View* find_bar_host_view_; | 631 View* find_bar_host_view_; |
632 | 632 |
633 // The download shelf view (view at the bottom of the page). | 633 // The download shelf view (view at the bottom of the page). |
634 scoped_ptr<DownloadShelfView> download_shelf_; | 634 std::unique_ptr<DownloadShelfView> download_shelf_; |
635 | 635 |
636 // The InfoBarContainerView that contains InfoBars for the current tab. | 636 // The InfoBarContainerView that contains InfoBars for the current tab. |
637 InfoBarContainerView* infobar_container_; | 637 InfoBarContainerView* infobar_container_; |
638 | 638 |
639 // The view that contains the selected WebContents. | 639 // The view that contains the selected WebContents. |
640 ContentsWebView* contents_web_view_; | 640 ContentsWebView* contents_web_view_; |
641 | 641 |
642 // The view that contains devtools window for the selected WebContents. | 642 // The view that contains devtools window for the selected WebContents. |
643 views::WebView* devtools_web_view_; | 643 views::WebView* devtools_web_view_; |
644 | 644 |
645 // The view managing the devtools and contents positions. | 645 // The view managing the devtools and contents positions. |
646 // Handled by ContentsLayoutManager. | 646 // Handled by ContentsLayoutManager. |
647 views::View* contents_container_; | 647 views::View* contents_container_; |
648 | 648 |
649 // Tracks and stores the last focused view which is not the | 649 // Tracks and stores the last focused view which is not the |
650 // devtools_web_view_ or any of its children. Used to restore focus once | 650 // devtools_web_view_ or any of its children. Used to restore focus once |
651 // the devtools_web_view_ is hidden. | 651 // the devtools_web_view_ is hidden. |
652 scoped_ptr<views::ExternalFocusTracker> devtools_focus_tracker_; | 652 std::unique_ptr<views::ExternalFocusTracker> devtools_focus_tracker_; |
653 | 653 |
654 // The Status information bubble that appears at the bottom of the window. | 654 // The Status information bubble that appears at the bottom of the window. |
655 scoped_ptr<StatusBubbleViews> status_bubble_; | 655 std::unique_ptr<StatusBubbleViews> status_bubble_; |
656 | 656 |
657 // A mapping between accelerators and commands. | 657 // A mapping between accelerators and commands. |
658 std::map<ui::Accelerator, int> accelerator_table_; | 658 std::map<ui::Accelerator, int> accelerator_table_; |
659 | 659 |
660 // True if we have already been initialized. | 660 // True if we have already been initialized. |
661 bool initialized_; | 661 bool initialized_; |
662 | 662 |
663 // True if we're currently handling a theme change (i.e. inside | 663 // True if we're currently handling a theme change (i.e. inside |
664 // OnThemeChanged()). | 664 // OnThemeChanged()). |
665 bool handling_theme_changed_; | 665 bool handling_theme_changed_; |
666 | 666 |
667 // True when in ProcessFullscreen(). The flag is used to avoid reentrance and | 667 // True when in ProcessFullscreen(). The flag is used to avoid reentrance and |
668 // to ignore requests to layout while in ProcessFullscreen() to reduce | 668 // to ignore requests to layout while in ProcessFullscreen() to reduce |
669 // jankiness. | 669 // jankiness. |
670 bool in_process_fullscreen_; | 670 bool in_process_fullscreen_; |
671 | 671 |
672 scoped_ptr<ExclusiveAccessBubbleViews> exclusive_access_bubble_; | 672 std::unique_ptr<ExclusiveAccessBubbleViews> exclusive_access_bubble_; |
673 | 673 |
674 #if defined(OS_WIN) | 674 #if defined(OS_WIN) |
675 // Helper class to listen for completion of first page load. | 675 // Helper class to listen for completion of first page load. |
676 scoped_ptr<LoadCompleteListener> load_complete_listener_; | 676 std::unique_ptr<LoadCompleteListener> load_complete_listener_; |
677 | 677 |
678 // The custom JumpList for Windows 7. | 678 // The custom JumpList for Windows 7. |
679 scoped_refptr<JumpList> jumplist_; | 679 scoped_refptr<JumpList> jumplist_; |
680 #endif | 680 #endif |
681 | 681 |
682 // The timer used to update frames for the Loading Animation. | 682 // The timer used to update frames for the Loading Animation. |
683 base::RepeatingTimer loading_animation_timer_; | 683 base::RepeatingTimer loading_animation_timer_; |
684 | 684 |
685 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; | 685 views::UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; |
686 | 686 |
687 // Used to measure the loading spinner animation rate. | 687 // Used to measure the loading spinner animation rate. |
688 base::TimeTicks last_animation_time_; | 688 base::TimeTicks last_animation_time_; |
689 | 689 |
690 // If this flag is set then SetFocusToLocationBar() will set focus to the | 690 // If this flag is set then SetFocusToLocationBar() will set focus to the |
691 // location bar even if the browser window is not active. | 691 // location bar even if the browser window is not active. |
692 bool force_location_bar_focus_; | 692 bool force_location_bar_focus_; |
693 | 693 |
694 scoped_ptr<ImmersiveModeController> immersive_mode_controller_; | 694 std::unique_ptr<ImmersiveModeController> immersive_mode_controller_; |
695 | 695 |
696 scoped_ptr<WebContentsCloseHandler> web_contents_close_handler_; | 696 std::unique_ptr<WebContentsCloseHandler> web_contents_close_handler_; |
697 | 697 |
698 SigninViewController signin_view_controller_; | 698 SigninViewController signin_view_controller_; |
699 | 699 |
700 // The class that registers for keyboard shortcuts for extension commands. | 700 // The class that registers for keyboard shortcuts for extension commands. |
701 scoped_ptr<ExtensionKeybindingRegistryViews> extension_keybinding_registry_; | 701 std::unique_ptr<ExtensionKeybindingRegistryViews> |
| 702 extension_keybinding_registry_; |
702 | 703 |
703 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; | 704 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; |
704 | 705 |
705 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 706 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
706 }; | 707 }; |
707 | 708 |
708 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 709 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
OLD | NEW |