| 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 <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/memory/scoped_ptr.h" | 13 #include "base/memory/scoped_ptr.h" |
| 14 #include "base/timer.h" | 14 #include "base/timer.h" |
| 15 #include "build/build_config.h" | 15 #include "build/build_config.h" |
| 16 #include "chrome/browser/devtools/devtools_window.h" | 16 #include "chrome/browser/devtools/devtools_window.h" |
| 17 #include "chrome/browser/infobars/infobar_container.h" | 17 #include "chrome/browser/infobars/infobar_container.h" |
| 18 #include "chrome/browser/ui/browser.h" | 18 #include "chrome/browser/ui/browser.h" |
| 19 #include "chrome/browser/ui/browser_window.h" | 19 #include "chrome/browser/ui/browser_window.h" |
| 20 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" | 20 #include "chrome/browser/ui/tabs/tab_strip_model_observer.h" |
| 21 #include "chrome/browser/ui/views/frame/browser_frame.h" | 21 #include "chrome/browser/ui/views/frame/browser_frame.h" |
| 22 #include "chrome/browser/ui/views/load_complete_listener.h" |
| 22 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" | 23 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
| 23 #include "ui/base/accelerators/accelerator.h" | 24 #include "ui/base/accelerators/accelerator.h" |
| 24 #include "ui/base/models/simple_menu_model.h" | 25 #include "ui/base/models/simple_menu_model.h" |
| 25 #include "ui/gfx/native_widget_types.h" | 26 #include "ui/gfx/native_widget_types.h" |
| 26 #include "ui/gfx/sys_color_change_listener.h" | 27 #include "ui/gfx/sys_color_change_listener.h" |
| 27 #include "ui/views/controls/button/button.h" | 28 #include "ui/views/controls/button/button.h" |
| 28 #include "ui/views/controls/single_split_view_listener.h" | 29 #include "ui/views/controls/single_split_view_listener.h" |
| 29 #include "ui/views/widget/widget_delegate.h" | 30 #include "ui/views/widget/widget_delegate.h" |
| 30 #include "ui/views/widget/widget_observer.h" | 31 #include "ui/views/widget/widget_observer.h" |
| 31 #include "ui/views/window/client_view.h" | 32 #include "ui/views/window/client_view.h" |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 88 // | 89 // |
| 89 class BrowserView : public BrowserWindow, | 90 class BrowserView : public BrowserWindow, |
| 90 public BrowserWindowTesting, | 91 public BrowserWindowTesting, |
| 91 public TabStripModelObserver, | 92 public TabStripModelObserver, |
| 92 public ui::AcceleratorProvider, | 93 public ui::AcceleratorProvider, |
| 93 public views::WidgetDelegate, | 94 public views::WidgetDelegate, |
| 94 public views::WidgetObserver, | 95 public views::WidgetObserver, |
| 95 public views::ClientView, | 96 public views::ClientView, |
| 96 public InfoBarContainer::Delegate, | 97 public InfoBarContainer::Delegate, |
| 97 public views::SingleSplitViewListener, | 98 public views::SingleSplitViewListener, |
| 98 public gfx::SysColorChangeListener { | 99 public gfx::SysColorChangeListener, |
| 100 public LoadCompleteListener::Delegate { |
| 99 public: | 101 public: |
| 100 // The browser view's class name. | 102 // The browser view's class name. |
| 101 static const char kViewClassName[]; | 103 static const char kViewClassName[]; |
| 102 // Initial child indices for well-known views. | 104 // Initial child indices for well-known views. |
| 103 static const int kTabstripIndex; | 105 static const int kTabstripIndex; |
| 104 static const int kInfoBarIndex; | 106 static const int kInfoBarIndex; |
| 105 static const int kToolbarIndex; | 107 static const int kToolbarIndex; |
| 106 | 108 |
| 107 explicit BrowserView(Browser* browser); | 109 explicit BrowserView(Browser* browser); |
| 108 virtual ~BrowserView(); | 110 virtual ~BrowserView(); |
| (...skipping 342 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 451 // Returns a new LayoutManager for this browser view. A subclass may | 453 // Returns a new LayoutManager for this browser view. A subclass may |
| 452 // override to implement different layout policy. | 454 // override to implement different layout policy. |
| 453 virtual views::LayoutManager* CreateLayoutManager() const; | 455 virtual views::LayoutManager* CreateLayoutManager() const; |
| 454 | 456 |
| 455 // Browser window related initializations. | 457 // Browser window related initializations. |
| 456 virtual void Init(); | 458 virtual void Init(); |
| 457 | 459 |
| 458 // Callback for the loading animation(s) associated with this view. | 460 // Callback for the loading animation(s) associated with this view. |
| 459 virtual void LoadingAnimationCallback(); | 461 virtual void LoadingAnimationCallback(); |
| 460 | 462 |
| 463 // LoadCompleteListener::Delegate implementation. Creates and initializes the |
| 464 // |jumplist_| after the first page load. |
| 465 virtual void OnLoadCompleted() OVERRIDE; |
| 466 |
| 461 private: | 467 private: |
| 462 friend class BrowserViewLayout; | 468 friend class BrowserViewLayout; |
| 463 FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest, | 469 FRIEND_TEST_ALL_PREFIXES(BrowserViewsAccessibilityTest, |
| 464 TestAboutChromeViewAccObj); | 470 TestAboutChromeViewAccObj); |
| 465 | 471 |
| 466 enum FullscreenType { | 472 enum FullscreenType { |
| 467 FOR_DESKTOP, | 473 FOR_DESKTOP, |
| 468 FOR_METRO | 474 FOR_METRO |
| 469 }; | 475 }; |
| 470 | 476 |
| (...skipping 223 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 694 | 700 |
| 695 // This object is initialized with the frame window HWND. This | 701 // This object is initialized with the frame window HWND. This |
| 696 // object is also passed as a tick handler with the ticker_ object. | 702 // object is also passed as a tick handler with the ticker_ object. |
| 697 // It is used to periodically monitor for hung plugin windows | 703 // It is used to periodically monitor for hung plugin windows |
| 698 HungWindowDetector hung_window_detector_; | 704 HungWindowDetector hung_window_detector_; |
| 699 | 705 |
| 700 // This object is invoked by hung_window_detector_ when it detects a hung | 706 // This object is invoked by hung_window_detector_ when it detects a hung |
| 701 // plugin window. | 707 // plugin window. |
| 702 HungPluginAction hung_plugin_action_; | 708 HungPluginAction hung_plugin_action_; |
| 703 | 709 |
| 710 // Helper class to listen for completion of first page load. |
| 711 scoped_ptr<LoadCompleteListener> load_complete_listener_; |
| 712 |
| 704 // The custom JumpList for Windows 7. | 713 // The custom JumpList for Windows 7. |
| 705 scoped_refptr<JumpList> jumplist_; | 714 scoped_refptr<JumpList> jumplist_; |
| 706 #endif | 715 #endif |
| 707 | 716 |
| 708 #if defined(USE_ASH) | 717 #if defined(USE_ASH) |
| 709 // Needs to be BrowserLauncerItemController for | 718 // Needs to be BrowserLauncerItemController for |
| 710 // "BrowserActivationStateChanged" and "favicon_loader". | 719 // "BrowserActivationStateChanged" and "favicon_loader". |
| 711 // TODO(skuhne): Remove once per-app is default. | 720 // TODO(skuhne): Remove once per-app is default. |
| 712 scoped_ptr<BrowserLauncherItemController> launcher_item_controller_; | 721 scoped_ptr<BrowserLauncherItemController> launcher_item_controller_; |
| 713 #endif | 722 #endif |
| (...skipping 17 matching lines...) Expand all Loading... |
| 731 gfx::ScopedSysColorChangeListener color_change_listener_; | 740 gfx::ScopedSysColorChangeListener color_change_listener_; |
| 732 | 741 |
| 733 scoped_ptr<InstantPreviewControllerViews> preview_controller_; | 742 scoped_ptr<InstantPreviewControllerViews> preview_controller_; |
| 734 | 743 |
| 735 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; | 744 mutable base::WeakPtrFactory<BrowserView> activate_modal_dialog_factory_; |
| 736 | 745 |
| 737 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 746 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
| 738 }; | 747 }; |
| 739 | 748 |
| 740 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 749 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
| OLD | NEW |