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

Side by Side Diff: chrome/browser/ui/views/tab_contents/tab_contents_container_native.cc

Issue 6284003: Modify a method that was added mid-refactoring so that it follows the new structure. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 9 years, 11 months 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 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h" 5 #include "chrome/browser/ui/views/tab_contents/tab_contents_container.h"
6 6
7 #include "chrome/browser/renderer_host/render_view_host.h" 7 #include "chrome/browser/renderer_host/render_view_host.h"
8 #include "chrome/browser/renderer_host/render_widget_host_view.h" 8 #include "chrome/browser/renderer_host/render_widget_host_view.h"
9 #include "chrome/browser/tab_contents/interstitial_page.h" 9 #include "chrome/browser/tab_contents/interstitial_page.h"
10 #include "chrome/browser/tab_contents/tab_contents.h" 10 #include "chrome/browser/tab_contents/tab_contents.h"
11 #include "chrome/browser/ui/view_ids.h" 11 #include "chrome/browser/ui/view_ids.h"
12 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h" 12 #include "chrome/browser/ui/views/tab_contents/native_tab_contents_container.h"
13 #include "chrome/common/notification_details.h" 13 #include "chrome/common/notification_details.h"
14 #include "chrome/common/notification_source.h" 14 #include "chrome/common/notification_source.h"
15 15
16 // Some of this class is implemented in tab_contents_container.cc, where 16 // Some of this class is implemented in tab_contents_container.cc, where
17 // the implementation doesn't vary between a pure views approach and a 17 // the implementation doesn't vary between a pure views approach and a
18 // native view host approach. See the header file for details. 18 // native view host approach. See the header file for details.
19 19
20 //////////////////////////////////////////////////////////////////////////////// 20 ////////////////////////////////////////////////////////////////////////////////
21 // TabContentsContainer, public: 21 // TabContentsContainer, public:
22 22
23 TabContentsContainer::TabContentsContainer() 23 TabContentsContainer::TabContentsContainer()
24 : native_container_(NULL), 24 : native_container_(NULL),
25 tab_contents_(NULL) { 25 tab_contents_(NULL) {
26 SetID(VIEW_ID_TAB_CONTAINER); 26 SetID(VIEW_ID_TAB_CONTAINER);
27 } 27 }
28 28
29 void TabContentsContainer::SetReservedContentsRect(
30 const gfx::Rect& reserved_rect) {
31 cached_reserved_rect_ = reserved_rect;
32 if (tab_contents_ && tab_contents_->GetRenderWidgetHostView()) {
33 tab_contents_->GetRenderWidgetHostView()->set_reserved_contents_rect(
34 reserved_rect);
35 }
36 }
37
29 void TabContentsContainer::ChangeTabContents(TabContents* contents) { 38 void TabContentsContainer::ChangeTabContents(TabContents* contents) {
30 if (tab_contents_) { 39 if (tab_contents_) {
31 native_container_->DetachContents(tab_contents_); 40 native_container_->DetachContents(tab_contents_);
32 tab_contents_->WasHidden(); 41 tab_contents_->WasHidden();
33 RemoveObservers(); 42 RemoveObservers();
34 } 43 }
35 tab_contents_ = contents; 44 tab_contents_ = contents;
36 // When detaching the last tab of the browser ChangeTabContents is invoked 45 // When detaching the last tab of the browser ChangeTabContents is invoked
37 // with NULL. Don't attempt to do anything in that case. 46 // with NULL. Don't attempt to do anything in that case.
38 if (tab_contents_) { 47 if (tab_contents_) {
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after
71 80
72 //////////////////////////////////////////////////////////////////////////////// 81 ////////////////////////////////////////////////////////////////////////////////
73 // TabContentsContainer, private: 82 // TabContentsContainer, private:
74 83
75 void TabContentsContainer::RenderViewHostChanged(RenderViewHost* old_host, 84 void TabContentsContainer::RenderViewHostChanged(RenderViewHost* old_host,
76 RenderViewHost* new_host) { 85 RenderViewHost* new_host) {
77 if (new_host) 86 if (new_host)
78 RenderWidgetHostViewChanged(new_host->view()); 87 RenderWidgetHostViewChanged(new_host->view());
79 native_container_->RenderViewHostChanged(old_host, new_host); 88 native_container_->RenderViewHostChanged(old_host, new_host);
80 } 89 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698