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

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

Issue 8498022: Have ExtensionHost use TabContents instead of RenderViewHost. Try #2. The first (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: cleanup 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 1473 matching lines...) Expand 10 before | Expand all | Expand 10 after
1690 1689
1691 // Update the URL display. 1690 // Update the URL display.
1692 NotifyNavigationStateChanged(TabContents::INVALIDATE_URL); 1691 NotifyNavigationStateChanged(TabContents::INVALIDATE_URL);
1693 } 1692 }
1694 1693
1695 void TabContents::DidChangeLoadProgress(double progress) { 1694 void TabContents::DidChangeLoadProgress(double progress) {
1696 if (delegate()) 1695 if (delegate())
1697 delegate()->LoadProgressChanged(progress); 1696 delegate()->LoadProgressChanged(progress);
1698 } 1697 }
1699 1698
1699 void TabContents::DocumentAvailableInMainFrame(
1700 RenderViewHost* render_view_host) {
1701 FOR_EACH_OBSERVER(TabContentsObserver, observers_,
1702 DocumentAvailableInMainFrame());
1703 }
1704
1700 void TabContents::DocumentOnLoadCompletedInMainFrame( 1705 void TabContents::DocumentOnLoadCompletedInMainFrame(
1701 RenderViewHost* render_view_host, 1706 RenderViewHost* render_view_host,
1702 int32 page_id) { 1707 int32 page_id) {
1703 content::NotificationService::current()->Notify( 1708 content::NotificationService::current()->Notify(
1704 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME, 1709 content::NOTIFICATION_LOAD_COMPLETED_MAIN_FRAME,
1705 content::Source<TabContents>(this), 1710 content::Source<TabContents>(this),
1706 content::Details<int>(&page_id)); 1711 content::Details<int>(&page_id));
1707 } 1712 }
1708 1713
1709 void TabContents::RequestOpenURL(const GURL& url, 1714 void TabContents::RequestOpenURL(const GURL& url,
(...skipping 305 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 2020
2016 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2021 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2017 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2022 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2018 rwh_view->SetSize(view()->GetContainerSize()); 2023 rwh_view->SetSize(view()->GetContainerSize());
2019 } 2024 }
2020 2025
2021 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2026 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2022 return render_view_host() ? 2027 return render_view_host() ?
2023 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2028 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2024 } 2029 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698