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 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <map> | 9 #include <map> |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
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/timer.h" | 15 #include "base/timer.h" |
16 #include "build/build_config.h" | 16 #include "build/build_config.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/unhandled_keyboard_event_handler.h" | 22 #include "chrome/browser/ui/views/unhandled_keyboard_event_handler.h" |
23 #include "ui/base/accelerators/accelerator.h" | 23 #include "ui/base/accelerators/accelerator.h" |
24 #include "ui/base/models/simple_menu_model.h" | 24 #include "ui/base/models/simple_menu_model.h" |
25 #include "ui/gfx/native_widget_types.h" | 25 #include "ui/gfx/native_widget_types.h" |
26 #include "ui/gfx/sys_color_change_listener.h" | 26 #include "ui/gfx/sys_color_change_listener.h" |
| 27 #include "ui/views/controls/button/image_button.h" |
27 #include "ui/views/controls/single_split_view_listener.h" | 28 #include "ui/views/controls/single_split_view_listener.h" |
28 #include "ui/views/widget/widget_delegate.h" | 29 #include "ui/views/widget/widget_delegate.h" |
29 #include "ui/views/window/client_view.h" | 30 #include "ui/views/window/client_view.h" |
30 | 31 |
31 #if defined(OS_WIN) | 32 #if defined(OS_WIN) |
32 #include "chrome/browser/hang_monitor/hung_plugin_action.h" | 33 #include "chrome/browser/hang_monitor/hung_plugin_action.h" |
33 #include "chrome/browser/hang_monitor/hung_window_detector.h" | 34 #include "chrome/browser/hang_monitor/hung_window_detector.h" |
34 #endif | 35 #endif |
35 | 36 |
36 // NOTE: For more information about the objects and files in this directory, | 37 // NOTE: For more information about the objects and files in this directory, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
72 // | 73 // |
73 class BrowserView : public BrowserWindow, | 74 class BrowserView : public BrowserWindow, |
74 public BrowserWindowTesting, | 75 public BrowserWindowTesting, |
75 public TabStripModelObserver, | 76 public TabStripModelObserver, |
76 public ui::AcceleratorProvider, | 77 public ui::AcceleratorProvider, |
77 public views::WidgetDelegate, | 78 public views::WidgetDelegate, |
78 public views::Widget::Observer, | 79 public views::Widget::Observer, |
79 public views::ClientView, | 80 public views::ClientView, |
80 public InfoBarContainer::Delegate, | 81 public InfoBarContainer::Delegate, |
81 public views::SingleSplitViewListener, | 82 public views::SingleSplitViewListener, |
| 83 public views::ButtonListener, |
82 public gfx::SysColorChangeListener { | 84 public gfx::SysColorChangeListener { |
83 public: | 85 public: |
84 // The browser view's class name. | 86 // The browser view's class name. |
85 static const char kViewClassName[]; | 87 static const char kViewClassName[]; |
86 | 88 |
87 explicit BrowserView(Browser* browser); | 89 explicit BrowserView(Browser* browser); |
88 virtual ~BrowserView(); | 90 virtual ~BrowserView(); |
89 | 91 |
90 void set_frame(BrowserFrame* frame) { frame_ = frame; } | 92 void set_frame(BrowserFrame* frame) { frame_ = frame; } |
91 BrowserFrame* frame() const { return frame_; } | 93 BrowserFrame* frame() const { return frame_; } |
(...skipping 282 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
374 virtual gfx::Size GetMinimumSize() OVERRIDE; | 376 virtual gfx::Size GetMinimumSize() OVERRIDE; |
375 | 377 |
376 // InfoBarContainer::Delegate overrides | 378 // InfoBarContainer::Delegate overrides |
377 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; | 379 virtual SkColor GetInfoBarSeparatorColor() const OVERRIDE; |
378 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; | 380 virtual void InfoBarContainerStateChanged(bool is_animating) OVERRIDE; |
379 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; | 381 virtual bool DrawInfoBarArrows(int* x) const OVERRIDE; |
380 | 382 |
381 // views::SingleSplitViewListener overrides: | 383 // views::SingleSplitViewListener overrides: |
382 virtual bool SplitHandleMoved(views::SingleSplitView* sender) OVERRIDE; | 384 virtual bool SplitHandleMoved(views::SingleSplitView* sender) OVERRIDE; |
383 | 385 |
| 386 // views::ImageButton override: |
| 387 virtual void ButtonPressed(views::Button* sender, |
| 388 const views::Event& event) OVERRIDE; |
| 389 |
384 // gfx::ScopedSysColorChangeListener overrides: | 390 // gfx::ScopedSysColorChangeListener overrides: |
385 virtual void OnSysColorChange() OVERRIDE; | 391 virtual void OnSysColorChange() OVERRIDE; |
386 | 392 |
387 protected: | 393 protected: |
388 // Appends to |toolbars| a pointer to each AccessiblePaneView that | 394 // Appends to |toolbars| a pointer to each AccessiblePaneView that |
389 // can be traversed using F6, in the order they should be traversed. | 395 // can be traversed using F6, in the order they should be traversed. |
390 // Abstracted here so that it can be extended for Chrome OS. | 396 // Abstracted here so that it can be extended for Chrome OS. |
391 virtual void GetAccessiblePanes( | 397 virtual void GetAccessiblePanes( |
392 std::vector<views::AccessiblePaneView*>* panes); | 398 std::vector<views::AccessiblePaneView*>* panes); |
393 | 399 |
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
576 // active_bookmark_bar_ is either NULL, if the bookmark bar isn't showing, | 582 // active_bookmark_bar_ is either NULL, if the bookmark bar isn't showing, |
577 // or is bookmark_bar_view_ if the bookmark bar is showing. | 583 // or is bookmark_bar_view_ if the bookmark bar is showing. |
578 views::View* active_bookmark_bar_; | 584 views::View* active_bookmark_bar_; |
579 | 585 |
580 // The TabStrip. | 586 // The TabStrip. |
581 TabStrip* tabstrip_; | 587 TabStrip* tabstrip_; |
582 | 588 |
583 // The Toolbar containing the navigation buttons, menus and the address bar. | 589 // The Toolbar containing the navigation buttons, menus and the address bar. |
584 ToolbarView* toolbar_; | 590 ToolbarView* toolbar_; |
585 | 591 |
| 592 // This button sits next to the tabs on the right hand side and it is used |
| 593 // only in windows metro metro mode to allow the user to flip among browser |
| 594 // windows. |
| 595 views::ImageButton* window_switcher_button_; |
| 596 |
586 // The Bookmark Bar View for this window. Lazily created. | 597 // The Bookmark Bar View for this window. Lazily created. |
587 scoped_ptr<BookmarkBarView> bookmark_bar_view_; | 598 scoped_ptr<BookmarkBarView> bookmark_bar_view_; |
588 | 599 |
589 // The download shelf view (view at the bottom of the page). | 600 // The download shelf view (view at the bottom of the page). |
590 scoped_ptr<DownloadShelfView> download_shelf_; | 601 scoped_ptr<DownloadShelfView> download_shelf_; |
591 | 602 |
592 // The InfoBarContainerView that contains InfoBars for the current tab. | 603 // The InfoBarContainerView that contains InfoBars for the current tab. |
593 InfoBarContainerView* infobar_container_; | 604 InfoBarContainerView* infobar_container_; |
594 | 605 |
595 // The view that contains the selected WebContents. | 606 // The view that contains the selected WebContents. |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
665 bool force_location_bar_focus_; | 676 bool force_location_bar_focus_; |
666 | 677 |
667 PendingFullscreenRequest fullscreen_request_; | 678 PendingFullscreenRequest fullscreen_request_; |
668 | 679 |
669 gfx::ScopedSysColorChangeListener color_change_listener_; | 680 gfx::ScopedSysColorChangeListener color_change_listener_; |
670 | 681 |
671 DISALLOW_COPY_AND_ASSIGN(BrowserView); | 682 DISALLOW_COPY_AND_ASSIGN(BrowserView); |
672 }; | 683 }; |
673 | 684 |
674 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ | 685 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ |
OLD | NEW |