| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 } |
| OLD | NEW |