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

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

Issue 5606012: Streamline the layout of the BrowserView's children TabContents views.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/menus/simple_menu_model.h" 13 #include "app/menus/simple_menu_model.h"
14 #include "base/scoped_ptr.h" 14 #include "base/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/browser_window.h" 17 #include "chrome/browser/browser_window.h"
18 #include "chrome/browser/tabs/tab_strip_model_observer.h" 18 #include "chrome/browser/tabs/tab_strip_model_observer.h"
19 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
20 #include "chrome/browser/views/frame/browser_bubble_host.h" 20 #include "chrome/browser/views/frame/browser_bubble_host.h"
21 #include "chrome/browser/views/frame/browser_frame.h" 21 #include "chrome/browser/views/frame/browser_frame.h"
22 #include "chrome/browser/views/infobars/infobar_container.h" 22 #include "chrome/browser/views/infobars/infobar_container.h"
23 #include "chrome/browser/views/tab_contents/tab_contents_container.h"
24 #include "chrome/browser/views/tabs/tab_strip.h" 23 #include "chrome/browser/views/tabs/tab_strip.h"
25 #include "chrome/browser/views/tabs/base_tab_strip.h" 24 #include "chrome/browser/views/tabs/base_tab_strip.h"
26 #include "chrome/browser/views/unhandled_keyboard_event_handler.h" 25 #include "chrome/browser/views/unhandled_keyboard_event_handler.h"
27 #include "chrome/common/notification_registrar.h" 26 #include "chrome/common/notification_registrar.h"
28 #include "gfx/native_widget_types.h" 27 #include "gfx/native_widget_types.h"
28 #include "views/controls/single_split_view.h"
29 #include "views/window/client_view.h" 29 #include "views/window/client_view.h"
30 #include "views/window/window_delegate.h" 30 #include "views/window/window_delegate.h"
31 31
32 #if defined(OS_WIN) 32 #if defined(OS_WIN)
33 #include "chrome/browser/hang_monitor/hung_plugin_action.h" 33 #include "chrome/browser/hang_monitor/hung_plugin_action.h"
34 #include "chrome/browser/hang_monitor/hung_window_detector.h" 34 #include "chrome/browser/hang_monitor/hung_window_detector.h"
35 #include "views/controls/menu/native_menu_win.h" 35 #include "views/controls/menu/native_menu_win.h"
36 #endif 36 #endif
37 37
38 // NOTE: For more information about the objects and files in this directory, 38 // NOTE: For more information about the objects and files in this directory,
39 // view: http://dev.chromium.org/developers/design-documents/browser-window 39 // view: http://dev.chromium.org/developers/design-documents/browser-window
40 40
41 class AccessiblePaneView; 41 class AccessiblePaneView;
42 class AccessibleViewHelper; 42 class AccessibleViewHelper;
43 class BookmarkBarView; 43 class BookmarkBarView;
44 class Browser; 44 class Browser;
45 class BrowserBubble; 45 class BrowserBubble;
46 class BrowserViewLayout; 46 class BrowserViewLayout;
47 class ContentsContainer; 47 class ContentsContainer;
48 class DownloadShelfView; 48 class DownloadShelfView;
49 class EncodingMenuModel; 49 class EncodingMenuModel;
50 class FullscreenExitBubble; 50 class FullscreenExitBubble;
51 class HtmlDialogUIDelegate; 51 class HtmlDialogUIDelegate;
52 class InfoBarContainer; 52 class InfoBarContainer;
53 class LocationBarView; 53 class LocationBarView;
54 class SideTabStrip; 54 class SideTabStrip;
55 class StatusBubbleViews; 55 class StatusBubbleViews;
56 class TabContentsContainer;
56 class TabStripModel; 57 class TabStripModel;
57 class ToolbarView; 58 class ToolbarView;
58 class ZoomMenuModel; 59 class ZoomMenuModel;
59 class Extension; 60 class Extension;
60 61
61 #if defined(OS_WIN) 62 #if defined(OS_WIN)
62 class AeroPeekManager; 63 class AeroPeekManager;
63 class JumpList; 64 class JumpList;
64 #endif 65 #endif
65 66
66 namespace views { 67 namespace views {
67 class ExternalFocusTracker; 68 class ExternalFocusTracker;
68 class Menu; 69 class Menu;
69 class SingleSplitView;
70 } 70 }
71 71
72 /////////////////////////////////////////////////////////////////////////////// 72 ///////////////////////////////////////////////////////////////////////////////
73 // BrowserView 73 // BrowserView
74 // 74 //
75 // A ClientView subclass that provides the contents of a browser window, 75 // A ClientView subclass that provides the contents of a browser window,
76 // including the TabStrip, toolbars, download shelves, the content area etc. 76 // including the TabStrip, toolbars, download shelves, the content area etc.
77 // 77 //
78 class BrowserView : public BrowserBubbleHost, 78 class BrowserView : public BrowserBubbleHost,
79 public BrowserWindow, 79 public BrowserWindow,
80 public BrowserWindowTesting, 80 public BrowserWindowTesting,
81 public NotificationObserver, 81 public NotificationObserver,
82 public TabStripModelObserver, 82 public TabStripModelObserver,
83 public menus::SimpleMenuModel::Delegate, 83 public menus::SimpleMenuModel::Delegate,
84 public views::WindowDelegate, 84 public views::WindowDelegate,
85 public views::ClientView, 85 public views::ClientView,
86 public InfoBarContainer::Delegate, 86 public InfoBarContainer::Delegate,
87 public TabContentsContainer::ReservedAreaDelegate { 87 public views::SingleSplitView::Observer {
88 public: 88 public:
89 // The browser view's class name. 89 // The browser view's class name.
90 static const char kViewClassName[]; 90 static const char kViewClassName[];
91 91
92 // Explicitly sets how windows are shown. Use a value of -1 to give the 92 // Explicitly sets how windows are shown. Use a value of -1 to give the
93 // default behavior. This is used during testing and not generally useful 93 // default behavior. This is used during testing and not generally useful
94 // otherwise. 94 // otherwise.
95 static void SetShowState(int state); 95 static void SetShowState(int state);
96 96
97 explicit BrowserView(Browser* browser); 97 explicit BrowserView(Browser* browser);
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after
385 virtual views::ClientView* CreateClientView(views::Window* window); 385 virtual views::ClientView* CreateClientView(views::Window* window);
386 386
387 // Overridden from views::ClientView: 387 // Overridden from views::ClientView:
388 virtual bool CanClose() const; 388 virtual bool CanClose() const;
389 virtual int NonClientHitTest(const gfx::Point& point); 389 virtual int NonClientHitTest(const gfx::Point& point);
390 virtual gfx::Size GetMinimumSize(); 390 virtual gfx::Size GetMinimumSize();
391 391
392 // InfoBarContainer::Delegate overrides 392 // InfoBarContainer::Delegate overrides
393 virtual void InfoBarSizeChanged(bool is_animating); 393 virtual void InfoBarSizeChanged(bool is_animating);
394 394
395 // TabContentsContainer::ReservedAreaDelegate overrides. 395 // views::SingleSplitView::Observer overrides:
396 virtual void UpdateReservedContentsRect(const TabContentsContainer* source); 396 virtual void SplitHandleMoved(views::SingleSplitView* view);
397 397
398 protected: 398 protected:
399 // Appends to |toolbars| a pointer to each AccessiblePaneView that 399 // Appends to |toolbars| a pointer to each AccessiblePaneView that
400 // can be traversed using F6, in the order they should be traversed. 400 // can be traversed using F6, in the order they should be traversed.
401 // Abstracted here so that it can be extended for Chrome OS. 401 // Abstracted here so that it can be extended for Chrome OS.
402 virtual void GetAccessiblePanes( 402 virtual void GetAccessiblePanes(
403 std::vector<AccessiblePaneView*>* panes); 403 std::vector<AccessiblePaneView*>* panes);
404 404
405 // Save the current focused view to view storage 405 // Save the current focused view to view storage
406 void SaveFocusedView(); 406 void SaveFocusedView();
(...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after
505 // Initialize the hung plugin detector. 505 // Initialize the hung plugin detector.
506 void InitHangMonitor(); 506 void InitHangMonitor();
507 507
508 // Invoked from TabSelectedAt or when instant is made active. Is 508 // Invoked from TabSelectedAt or when instant is made active. Is
509 // |change_tab_contents| is true, |new_contents| is added to the view 509 // |change_tab_contents| is true, |new_contents| is added to the view
510 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents| 510 // hierarchy, if |change_tab_contents| is false, it's assumed |new_contents|
511 // has already been added to the view hierarchy. 511 // has already been added to the view hierarchy.
512 void ProcessTabSelected(TabContentsWrapper* new_contents, 512 void ProcessTabSelected(TabContentsWrapper* new_contents,
513 bool change_tab_contents); 513 bool change_tab_contents);
514 514
515 // Exposes resize corner size to BrowserViewLayout.
516 gfx::Size GetResizeCornerSize() const;
517
515 // Last focused view that issued a tab traversal. 518 // Last focused view that issued a tab traversal.
516 int last_focused_view_storage_id_; 519 int last_focused_view_storage_id_;
517 520
518 // The BrowserFrame that hosts this view. 521 // The BrowserFrame that hosts this view.
519 BrowserFrame* frame_; 522 BrowserFrame* frame_;
520 523
521 // The Browser object we are associated with. 524 // The Browser object we are associated with.
522 scoped_ptr<Browser> browser_; 525 scoped_ptr<Browser> browser_;
523 526
524 // BrowserView layout (LTR one is pictured here). 527 // BrowserView layout (LTR one is pictured here).
(...skipping 132 matching lines...) Expand 10 before | Expand all | Expand 10 after
657 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_; 660 UnhandledKeyboardEventHandler unhandled_keyboard_event_handler_;
658 661
659 scoped_ptr<AccessibleViewHelper> accessible_view_helper_; 662 scoped_ptr<AccessibleViewHelper> accessible_view_helper_;
660 663
661 NotificationRegistrar registrar_; 664 NotificationRegistrar registrar_;
662 665
663 DISALLOW_COPY_AND_ASSIGN(BrowserView); 666 DISALLOW_COPY_AND_ASSIGN(BrowserView);
664 }; 667 };
665 668
666 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_ 669 #endif // CHROME_BROWSER_UI_VIEWS_FRAME_BROWSER_VIEW_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/frame/browser_view.cc » ('j') | chrome/browser/ui/views/frame/browser_view.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698