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

Side by Side Diff: chrome/browser/views/tab_contents/tab_contents_container.h

Issue 3547008: Handle resize corner layout entirely in the platform BrowserWindow*/BrowserView* code... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ 5 #ifndef CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_
6 #define CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ 6 #define CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/views/tab_contents/native_tab_contents_container.h" 9 #include "chrome/browser/views/tab_contents/native_tab_contents_container.h"
10 #include "chrome/common/notification_observer.h" 10 #include "chrome/common/notification_observer.h"
11 #include "chrome/common/notification_registrar.h" 11 #include "chrome/common/notification_registrar.h"
12 #include "views/view.h" 12 #include "views/view.h"
13 13
14 class NativeTabContentsContainer; 14 class NativeTabContentsContainer;
15 class RenderViewHost; 15 class RenderViewHost;
16 class RenderWidgetHostView;
16 class TabContents; 17 class TabContents;
17 18
18 class TabContentsContainer : public views::View, 19 class TabContentsContainer : public views::View,
19 public NotificationObserver { 20 public NotificationObserver {
20 public: 21 public:
22 // Interface to enquire reserved contents area.
23 class ReservedAreaDelegate {
24 public:
25 // Returns the rect in tab contents view coordinates where contents should
rohitrao (ping after 24h) 2010/11/12 18:45:19 This comment no longer applies. From the method n
Aleksey Shlyapnikov 2010/11/13 01:37:11 Done.
26 // not be rendered (to display the resize corner, sidebar mini tabs etc.),
27 // if any, otherwise an empty rect.
28 virtual void UpdateReservedContentsRect(
29 const TabContentsContainer* source) = 0;
30 protected:
31 virtual ~ReservedAreaDelegate() {}
32 };
33
21 TabContentsContainer(); 34 TabContentsContainer();
22 virtual ~TabContentsContainer(); 35 virtual ~TabContentsContainer();
23 36
24 // Changes the TabContents associated with this view. 37 // Changes the TabContents associated with this view.
25 void ChangeTabContents(TabContents* contents); 38 void ChangeTabContents(TabContents* contents);
26 39
27 View* GetFocusView() { return native_container_->GetView(); } 40 View* GetFocusView() { return native_container_->GetView(); }
28 41
29 // Accessor for |tab_contents_|. 42 // Accessor for |tab_contents_|.
30 TabContents* tab_contents() const { return tab_contents_; } 43 TabContents* tab_contents() const { return tab_contents_; }
31 44
32 // Called by the BrowserView to notify that |tab_contents| got the focus. 45 // Called by the BrowserView to notify that |tab_contents| got the focus.
33 void TabContentsFocused(TabContents* tab_contents); 46 void TabContentsFocused(TabContents* tab_contents);
34 47
35 // Tells the container to update less frequently during resizing operations 48 // Tells the container to update less frequently during resizing operations
36 // so performance is better. 49 // so performance is better.
37 void SetFastResize(bool fast_resize); 50 void SetFastResize(bool fast_resize);
38 51
52 void set_reserved_area_delegate(ReservedAreaDelegate* delegate) {
53 reserved_area_delegate_ = delegate;
54 }
55
39 // Overridden from NotificationObserver: 56 // Overridden from NotificationObserver:
40 virtual void Observe(NotificationType type, 57 virtual void Observe(NotificationType type,
41 const NotificationSource& source, 58 const NotificationSource& source,
42 const NotificationDetails& details); 59 const NotificationDetails& details);
43 60
44 // Overridden from views::View: 61 // Overridden from views::View:
45 virtual void Layout(); 62 virtual void Layout();
46 virtual AccessibilityTypes::Role GetAccessibleRole(); 63 virtual AccessibilityTypes::Role GetAccessibleRole();
47 64
48 protected: 65 protected:
49 // Overridden from views::View: 66 // Overridden from views::View:
50 virtual void ViewHierarchyChanged(bool is_add, views::View* parent, 67 virtual void ViewHierarchyChanged(bool is_add, views::View* parent,
51 views::View* child); 68 views::View* child);
52 69
53 private: 70 private:
54 // Add or remove observers for events that we care about. 71 // Add or remove observers for events that we care about.
55 void AddObservers(); 72 void AddObservers();
56 void RemoveObservers(); 73 void RemoveObservers();
57 74
58 // Called when the RenderViewHost of the hosted TabContents has changed, e.g. 75 // Called when the RenderViewHost of the hosted TabContents has changed, e.g.
59 // to show an interstitial page. 76 // to show an interstitial page.
60 void RenderViewHostChanged(RenderViewHost* old_host, 77 void RenderViewHostChanged(RenderViewHost* old_host,
61 RenderViewHost* new_host); 78 RenderViewHost* new_host);
62 79
63 // Called when a TabContents is destroyed. This gives us a chance to clean 80 // Called when a TabContents is destroyed. This gives us a chance to clean
64 // up our internal state if the TabContents is somehow destroyed before we 81 // up our internal state if the TabContents is somehow destroyed before we
65 // get notified. 82 // get notified.
66 void TabContentsDestroyed(TabContents* contents); 83 void TabContentsDestroyed(TabContents* contents);
67 84
85 // Called when the RenderWidgetHostView of the hosted TabContents has changed.
86 void RenderWidgetHostViewChanged(RenderWidgetHostView* old_view,
87 RenderWidgetHostView* new_view);
88
68 // An instance of a NativeTabContentsContainer object that holds the native 89 // An instance of a NativeTabContentsContainer object that holds the native
69 // view handle associated with the attached TabContents. 90 // view handle associated with the attached TabContents.
70 NativeTabContentsContainer* native_container_; 91 NativeTabContentsContainer* native_container_;
71 92
72 // The attached TabContents. 93 // The attached TabContents.
73 TabContents* tab_contents_; 94 TabContents* tab_contents_;
74 95
75 // Handles registering for our notifications. 96 // Handles registering for our notifications.
76 NotificationRegistrar registrar_; 97 NotificationRegistrar registrar_;
77 98
99 // Delegate for enquiring reserved contents area. Not owned by us.
100 ReservedAreaDelegate* reserved_area_delegate_;
101
78 DISALLOW_COPY_AND_ASSIGN(TabContentsContainer); 102 DISALLOW_COPY_AND_ASSIGN(TabContentsContainer);
79 }; 103 };
80 104
81 #endif // CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_ 105 #endif // CHROME_BROWSER_VIEWS_TAB_CONTENTS_TAB_CONTENTS_CONTAINER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698