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

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

Issue 8587001: Have ExtensionHost use TabContents instead of RenderViewHost. Try #3. (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
207 render_manager_.Init(browser_context, site_instance, routing_id); 206 render_manager_.Init(browser_context, site_instance, routing_id);
208 207
209 // We have the initial size of the view be based on the size of the passed in 208 // We have the initial size of the view be based on the size of the passed in
210 // tab contents (normally a tab from the same window). 209 // tab contents (normally a tab from the same window).
211 view_->CreateView(base_tab_contents ? 210 view_->CreateView(base_tab_contents ?
212 base_tab_contents->view()->GetContainerSize() : gfx::Size()); 211 base_tab_contents->view()->GetContainerSize() : gfx::Size());
213 212
214 #if defined(ENABLE_JAVA_BRIDGE) 213 #if defined(ENABLE_JAVA_BRIDGE)
215 java_bridge_dispatcher_host_manager_.reset( 214 java_bridge_dispatcher_host_manager_.reset(
216 new JavaBridgeDispatcherHostManager(this)); 215 new JavaBridgeDispatcherHostManager(this));
(...skipping 1480 matching lines...) Expand 10 before | Expand all | Expand 10 after
1697 1696
1698 // Update the URL display. 1697 // Update the URL display.
1699 NotifyNavigationStateChanged(TabContents::INVALIDATE_URL); 1698 NotifyNavigationStateChanged(TabContents::INVALIDATE_URL);
1700 } 1699 }
1701 1700
1702 void TabContents::DidChangeLoadProgress(double progress) { 1701 void TabContents::DidChangeLoadProgress(double progress) {
1703 if (delegate()) 1702 if (delegate())
1704 delegate()->LoadProgressChanged(progress); 1703 delegate()->LoadProgressChanged(progress);
1705 } 1704 }
1706 1705
1706 void TabContents::DocumentAvailableInMainFrame(
1707 RenderViewHost* render_view_host) {
1708 FOR_EACH_OBSERVER(TabContentsObserver, observers_,
1709 DocumentAvailableInMainFrame());
1710 }
1711
1707 void TabContents::DocumentOnLoadCompletedInMainFrame( 1712 void TabContents::DocumentOnLoadCompletedInMainFrame(
1708 RenderViewHost* render_view_host, 1713 RenderViewHost* render_view_host,
1709 int32 page_id) { 1714 int32 page_id) {
1710 content::NotificationService::current()->Notify( 1715 content::NotificationService::current()->Notify(
1711 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 1716 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
1712 content::Source<TabContents>(this), 1717 content::Source<TabContents>(this),
1713 content::Details<int>(&page_id)); 1718 content::Details<int>(&page_id));
1714 } 1719 }
1715 1720
1716 void TabContents::RequestOpenURL(const GURL& url, 1721 void TabContents::RequestOpenURL(const GURL& url,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2022 2027
2023 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2028 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2024 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2029 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2025 rwh_view->SetSize(view()->GetContainerSize()); 2030 rwh_view->SetSize(view()->GetContainerSize());
2026 } 2031 }
2027 2032
2028 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2033 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2029 return render_view_host() ? 2034 return render_view_host() ?
2030 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2035 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2031 } 2036 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698