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

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

Issue 6677030: Fixes crash if instant is enabled and you block JS. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Adds test Created 9 years, 9 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
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/renderer/searchbox_extension.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "chrome/browser/instant/instant_loader.h" 5 #include "chrome/browser/instant/instant_loader.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <string> 8 #include <string>
9 #include <utility> 9 #include <utility>
10 #include <vector> 10 #include <vector>
(...skipping 526 matching lines...) Expand 10 before | Expand all | Expand 10 after
537 } 537 }
538 538
539 void InstantLoader::TabContentsDelegateImpl::OnInstantSupportDetermined( 539 void InstantLoader::TabContentsDelegateImpl::OnInstantSupportDetermined(
540 int32 page_id, 540 int32 page_id,
541 bool result) { 541 bool result) {
542 TabContents* source = loader_->preview_contents()->tab_contents(); 542 TabContents* source = loader_->preview_contents()->tab_contents();
543 if (!source->controller().GetActiveEntry() || 543 if (!source->controller().GetActiveEntry() ||
544 page_id != source->controller().GetActiveEntry()->page_id()) 544 page_id != source->controller().GetActiveEntry()->page_id())
545 return; 545 return;
546 546
547 Details<const bool> details(&result);
548 NotificationService::current()->Notify(
549 NotificationType::INSTANT_SUPPORT_DETERMINED,
550 NotificationService::AllSources(),
551 details);
552
547 if (result) 553 if (result)
548 loader_->PageFinishedLoading(); 554 loader_->PageFinishedLoading();
549 else 555 else
550 loader_->PageDoesntSupportInstant(user_typed_before_load_); 556 loader_->PageDoesntSupportInstant(user_typed_before_load_);
551 } 557 }
552 558
553 bool InstantLoader::TabContentsDelegateImpl::ShouldShowHungRendererDialog() { 559 bool InstantLoader::TabContentsDelegateImpl::ShouldShowHungRendererDialog() {
554 // If we allow the hung renderer dialog to be shown it'll gain focus, 560 // If we allow the hung renderer dialog to be shown it'll gain focus,
555 // stealing focus from the omnibox causing instant to be cancelled. Return 561 // stealing focus from the omnibox causing instant to be cancelled. Return
556 // false so that doesn't happen. 562 // false so that doesn't happen.
(...skipping 395 matching lines...) Expand 10 before | Expand all | Expand 10 after
952 Source<NavigationController>(&preview_contents_->controller())); 958 Source<NavigationController>(&preview_contents_->controller()));
953 #endif 959 #endif
954 960
955 registrar_.Add( 961 registrar_.Add(
956 this, 962 this,
957 NotificationType::NAV_ENTRY_COMMITTED, 963 NotificationType::NAV_ENTRY_COMMITTED,
958 Source<NavigationController>(&preview_contents_->controller())); 964 Source<NavigationController>(&preview_contents_->controller()));
959 965
960 preview_contents_->tab_contents()->ShowContents(); 966 preview_contents_->tab_contents()->ShowContents();
961 } 967 }
OLDNEW
« no previous file with comments | « chrome/browser/instant/instant_browsertest.cc ('k') | chrome/renderer/searchbox_extension.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698