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

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

Issue 8469015: Switch BackgroundContents to use TabContents instead of RenderViewHost. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: fix unittest 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 1268 matching lines...) Expand 10 before | Expand all | Expand 10 after
1279 } 1279 }
1280 1280
1281 if (!details.is_in_page) { 1281 if (!details.is_in_page) {
1282 // Once the main frame is navigated, we're no longer considered to have 1282 // Once the main frame is navigated, we're no longer considered to have
1283 // displayed insecure content. 1283 // displayed insecure content.
1284 displayed_insecure_content_ = false; 1284 displayed_insecure_content_ = false;
1285 } 1285 }
1286 1286
1287 // Notify observers about navigation. 1287 // Notify observers about navigation.
1288 FOR_EACH_OBSERVER(TabContentsObserver, observers_, 1288 FOR_EACH_OBSERVER(TabContentsObserver, observers_,
1289 DidNavigateMainFramePostCommit(details, params)); 1289 DidNavigateMainFrame(details, params));
1290 } 1290 }
1291 1291
1292 void TabContents::DidNavigateAnyFramePostCommit( 1292 void TabContents::DidNavigateAnyFramePostCommit(
1293 RenderViewHost* render_view_host, 1293 RenderViewHost* render_view_host,
1294 const content::LoadCommittedDetails& details, 1294 const content::LoadCommittedDetails& details,
1295 const ViewHostMsg_FrameNavigate_Params& params) { 1295 const ViewHostMsg_FrameNavigate_Params& params) {
1296 // If we navigate, reset JavaScript state. This does nothing to prevent 1296 // If we navigate, reset JavaScript state. This does nothing to prevent
1297 // a malicious script from spamming messages, since the script could just 1297 // a malicious script from spamming messages, since the script could just
1298 // reload the page to stop blocking. 1298 // reload the page to stop blocking.
1299 if (dialog_creator_) { 1299 if (dialog_creator_) {
1300 dialog_creator_->ResetJavaScriptState(this); 1300 dialog_creator_->ResetJavaScriptState(this);
1301 dialog_creator_ = NULL; 1301 dialog_creator_ = NULL;
1302 } 1302 }
1303 1303
1304 // Notify observers about navigation. 1304 // Notify observers about navigation.
1305 FOR_EACH_OBSERVER(TabContentsObserver, observers_, 1305 FOR_EACH_OBSERVER(TabContentsObserver, observers_,
1306 DidNavigateAnyFramePostCommit(details, params)); 1306 DidNavigateAnyFrame(details, params));
1307 } 1307 }
1308 1308
1309 void TabContents::UpdateMaxPageIDIfNecessary(SiteInstance* site_instance, 1309 void TabContents::UpdateMaxPageIDIfNecessary(SiteInstance* site_instance,
1310 RenderViewHost* rvh) { 1310 RenderViewHost* rvh) {
1311 // If we are creating a RVH for a restored controller, then we might 1311 // If we are creating a RVH for a restored controller, then we might
1312 // have more page IDs than the SiteInstance's current max page ID. We must 1312 // have more page IDs than the SiteInstance's current max page ID. We must
1313 // make sure that the max page ID is larger than any restored page ID. 1313 // make sure that the max page ID is larger than any restored page ID.
1314 // Note that it is ok for conflicting page IDs to exist in another tab 1314 // Note that it is ok for conflicting page IDs to exist in another tab
1315 // (i.e., NavigationController), but if any page ID is larger than the max, 1315 // (i.e., NavigationController), but if any page ID is larger than the max,
1316 // the back/forward list will get confused. 1316 // the back/forward list will get confused.
(...skipping 698 matching lines...) Expand 10 before | Expand all | Expand 10 after
2015 2015
2016 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) { 2016 void TabContents::CreateViewAndSetSizeForRVH(RenderViewHost* rvh) {
2017 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh); 2017 RenderWidgetHostView* rwh_view = view()->CreateViewForWidget(rvh);
2018 rwh_view->SetSize(view()->GetContainerSize()); 2018 rwh_view->SetSize(view()->GetContainerSize());
2019 } 2019 }
2020 2020
2021 bool TabContents::GotResponseToLockMouseRequest(bool allowed) { 2021 bool TabContents::GotResponseToLockMouseRequest(bool allowed) {
2022 return render_view_host() ? 2022 return render_view_host() ?
2023 render_view_host()->GotResponseToLockMouseRequest(allowed) : false; 2023 render_view_host()->GotResponseToLockMouseRequest(allowed) : false;
2024 } 2024 }
OLDNEW
« no previous file with comments | « content/browser/renderer_host/render_view_host_delegate.cc ('k') | content/browser/tab_contents/tab_contents_observer.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698