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

Side by Side Diff: content/browser/tab_contents/tab_contents.cc

Issue 8520036: Revert 110262 - Have ExtensionHost use TabContents instead of RenderViewHost. Try #2. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 9 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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 "content/browser/tab_contents/tab_contents.h" 5 #include "content/browser/tab_contents/tab_contents.h"
6 6
7 #include <cmath> 7 #include <cmath>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after
196 is_showing_before_unload_dialog_(false), 196 is_showing_before_unload_dialog_(false),
197 opener_web_ui_type_(WebUI::kNoWebUI), 197 opener_web_ui_type_(WebUI::kNoWebUI),
198 closed_by_user_gesture_(false), 198 closed_by_user_gesture_(false),
199 minimum_zoom_percent_( 199 minimum_zoom_percent_(
200 static_cast<int>(WebKit::WebView::minTextSizeMultiplier * 100)), 200 static_cast<int>(WebKit::WebView::minTextSizeMultiplier * 100)),
201 maximum_zoom_percent_( 201 maximum_zoom_percent_(
202 static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)), 202 static_cast<int>(WebKit::WebView::maxTextSizeMultiplier * 100)),
203 temporary_zoom_settings_(false), 203 temporary_zoom_settings_(false),
204 content_restrictions_(0), 204 content_restrictions_(0),
205 view_type_(content::VIEW_TYPE_TAB_CONTENTS) { 205 view_type_(content::VIEW_TYPE_TAB_CONTENTS) {
206
206 render_manager_.Init(browser_context, site_instance, routing_id); 207 render_manager_.Init(browser_context, site_instance, routing_id);
207 208
208 // We have the initial size of the view be based on the size of the passed in 209 // We have the initial size of the view be based on the size of the passed in
209 // tab contents (normally a tab from the same window). 210 // tab contents (normally a tab from the same window).
210 view_->CreateView(base_tab_contents ? 211 view_->CreateView(base_tab_contents ?
211 base_tab_contents->view()->GetContainerSize() : gfx::Size()); 212 base_tab_contents->view()->GetContainerSize() : gfx::Size());
212 213
213 #if defined(ENABLE_JAVA_BRIDGE) 214 #if defined(ENABLE_JAVA_BRIDGE)
214 java_bridge_dispatcher_host_manager_.reset( 215 java_bridge_dispatcher_host_manager_.reset(
215 new JavaBridgeDispatcherHostManager(this)); 216 new JavaBridgeDispatcherHostManager(this));
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1696 1697
1697 // Update the URL display. 1698 // Update the URL display.
1698 NotifyNavigationStateChanged(TabContents::INVALIDATE_URL); 1699 NotifyNavigationStateChanged(TabContents::INVALIDATE_URL);
1699 } 1700 }
1700 1701
1701 void TabContents::DidChangeLoadProgress(double progress) { 1702 void TabContents::DidChangeLoadProgress(double progress) {
1702 if (delegate()) 1703 if (delegate())
1703 delegate()->LoadProgressChanged(progress); 1704 delegate()->LoadProgressChanged(progress);
1704 } 1705 }
1705 1706
1706 void TabContents::DocumentAvailableInMainFrame(
1707 RenderViewHost* render_view_host) {
1708 FOR_EACH_OBSERVER(TabContentsObserver, observers_,
1709 DocumentAvailableInMainFrame());
1710 }
1711
1712 void TabContents::DocumentOnLoadCompletedInMainFrame( 1707 void TabContents::DocumentOnLoadCompletedInMainFrame(
1713 RenderViewHost* render_view_host, 1708 RenderViewHost* render_view_host,
1714 int32 page_id) { 1709 int32 page_id) {
1715 content::NotificationService::current()->Notify( 1710 content::NotificationService::current()->Notify(
1716 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 1711 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
1717 content::Source<TabContents>(this), 1712 content::Source<TabContents>(this),
1718 content::Details<int>(&page_id)); 1713 content::Details<int>(&page_id));
1719 } 1714 }
1720 1715
1721 void TabContents::RequestOpenURL(const GURL& url, 1716 void TabContents::RequestOpenURL(const GURL& url,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2027 2022
2028 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2023 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2029 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2024 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2030 rwh_view->SetSize(view()->GetContainerSize()); 2025 rwh_view->SetSize(view()->GetContainerSize());
2031 } 2026 }
2032 2027
2033 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2028 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2034 return render_view_host() ? 2029 return render_view_host() ?
2035 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2030 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2036 } 2031 }
OLDNEW
« no previous file with comments | « content/browser/tab_contents/tab_contents.h ('k') | content/browser/tab_contents/tab_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698