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

Side by Side Diff: chrome/browser/instant/instant_loader.cc

Issue 12001002: InstantExtended: Transient naventry for preview. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Address comment. Created 7 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 2012 The Chromium Authors. All rights reserved. 1 // Copyright 2012 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/instant/instant_loader.h" 5 #include "chrome/browser/instant/instant_loader.h"
6 6
7 #include "chrome/browser/content_settings/tab_specific_content_settings.h" 7 #include "chrome/browser/content_settings/tab_specific_content_settings.h"
8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h" 8 #include "chrome/browser/extensions/api/web_navigation/web_navigation_api.h"
9 #include "chrome/browser/favicon/favicon_tab_helper.h" 9 #include "chrome/browser/favicon/favicon_tab_helper.h"
10 #include "chrome/browser/history/history_tab_helper.h" 10 #include "chrome/browser/history/history_tab_helper.h"
11 #include "chrome/browser/instant/instant_controller.h" 11 #include "chrome/browser/instant/instant_controller.h"
12 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h" 12 #include "chrome/browser/safe_browsing/safe_browsing_tab_observer.h"
13 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h" 13 #include "chrome/browser/ui/blocked_content/blocked_content_tab_helper.h"
14 #include "chrome/browser/ui/search/search_tab_helper.h" 14 #include "chrome/browser/ui/search/search_tab_helper.h"
15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h" 15 #include "chrome/browser/ui/tab_contents/core_tab_helper.h"
16 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h" 16 #include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
17 #include "content/public/browser/navigation_entry.h"
17 #include "content/public/browser/notification_source.h" 18 #include "content/public/browser/notification_source.h"
18 #include "content/public/browser/notification_types.h" 19 #include "content/public/browser/notification_types.h"
19 #include "content/public/browser/render_widget_host_view.h" 20 #include "content/public/browser/render_widget_host_view.h"
20 #include "content/public/browser/web_contents_delegate.h" 21 #include "content/public/browser/web_contents_delegate.h"
21 #include "content/public/browser/web_contents_view.h" 22 #include "content/public/browser/web_contents_view.h"
22 #include "ipc/ipc_message.h" 23 #include "ipc/ipc_message.h"
23 24
24 namespace { 25 namespace {
25 26
26 int kUserDataKey; 27 int kUserDataKey;
(...skipping 253 matching lines...) Expand 10 before | Expand all | Expand 10 after
280 InstantSupportDetermined(true); 281 InstantSupportDetermined(true);
281 controller_->SetSuggestions(contents(), suggestions); 282 controller_->SetSuggestions(contents(), suggestions);
282 } 283 }
283 284
284 void InstantLoader::InstantSupportDetermined(bool supports_instant) { 285 void InstantLoader::InstantSupportDetermined(bool supports_instant) {
285 // If we had already determined that the page supports Instant, nothing to do. 286 // If we had already determined that the page supports Instant, nothing to do.
286 if (supports_instant_) 287 if (supports_instant_)
287 return; 288 return;
288 289
289 supports_instant_ = supports_instant; 290 supports_instant_ = supports_instant;
291 const content::NavigationEntry* entry =
292 contents()->GetController().GetVisibleEntry();
293 base_navigation_entry_.reset(content::NavigationEntry::Create(*entry));
290 controller_->InstantSupportDetermined(contents(), supports_instant); 294 controller_->InstantSupportDetermined(contents(), supports_instant);
291 } 295 }
292 296
293 void InstantLoader::ShowInstantPreview(InstantShownReason reason, 297 void InstantLoader::ShowInstantPreview(InstantShownReason reason,
294 int height, 298 int height,
295 InstantSizeUnits units) { 299 InstantSizeUnits units) {
296 InstantSupportDetermined(true); 300 InstantSupportDetermined(true);
297 controller_->ShowInstantPreview(reason, height, units); 301 controller_->ShowInstantPreview(reason, height, units);
298 } 302 }
299 303
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
408 content::WebContents* new_contents) { 412 content::WebContents* new_contents) {
409 DCHECK_EQ(old_contents, contents()); 413 DCHECK_EQ(old_contents, contents());
410 CleanupPreviewContents(); 414 CleanupPreviewContents();
411 // We release here without deleting so that the caller still has the 415 // We release here without deleting so that the caller still has the
412 // responsibility for deleting the WebContents. 416 // responsibility for deleting the WebContents.
413 ignore_result(contents_.release()); 417 ignore_result(contents_.release());
414 contents_.reset(new_contents); 418 contents_.reset(new_contents);
415 SetupPreviewContents(); 419 SetupPreviewContents();
416 controller_->SwappedWebContents(); 420 controller_->SwappedWebContents();
417 } 421 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698