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 "content/browser/tab_contents/interstitial_page.h" | 5 #include "content/browser/tab_contents/interstitial_page.h" |
6 | 6 |
7 #include <vector> | 7 #include <vector> |
8 | 8 |
9 #include "base/compiler_specific.h" | 9 #include "base/compiler_specific.h" |
10 #include "base/message_loop.h" | 10 #include "base/message_loop.h" |
(...skipping 252 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
263 tab_->render_view_host()->view()->Focus(); | 263 tab_->render_view_host()->view()->Focus(); |
264 } | 264 } |
265 | 265 |
266 render_view_host_->Shutdown(); | 266 render_view_host_->Shutdown(); |
267 render_view_host_ = NULL; | 267 render_view_host_ = NULL; |
268 if (tab_->interstitial_page()) | 268 if (tab_->interstitial_page()) |
269 tab_->remove_interstitial_page(); | 269 tab_->remove_interstitial_page(); |
270 // Let's revert to the original title if necessary. | 270 // Let's revert to the original title if necessary. |
271 NavigationEntry* entry = tab_->controller().GetActiveEntry(); | 271 NavigationEntry* entry = tab_->controller().GetActiveEntry(); |
272 if (!new_navigation_ && should_revert_tab_title_) { | 272 if (!new_navigation_ && should_revert_tab_title_) { |
273 entry->set_title(WideToUTF16Hack(original_tab_title_)); | 273 entry->set_title(original_tab_title_); |
274 tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE); | 274 tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE); |
275 } | 275 } |
276 delete this; | 276 delete this; |
277 } | 277 } |
278 | 278 |
279 void InterstitialPage::Observe(NotificationType type, | 279 void InterstitialPage::Observe(NotificationType type, |
280 const NotificationSource& source, | 280 const NotificationSource& source, |
281 const NotificationDetails& details) { | 281 const NotificationDetails& details) { |
282 switch (type.value) { | 282 switch (type.value) { |
283 case NotificationType::NAV_ENTRY_PENDING: | 283 case NotificationType::NAV_ENTRY_PENDING: |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
398 // SafeBrowsingBlockingPage, when the resource triggering the interstitial | 398 // SafeBrowsingBlockingPage, when the resource triggering the interstitial |
399 // is a sub-resource, meaning the main page has already been loaded and a | 399 // is a sub-resource, meaning the main page has already been loaded and a |
400 // navigation entry should have been created. | 400 // navigation entry should have been created. |
401 NOTREACHED(); | 401 NOTREACHED(); |
402 return; | 402 return; |
403 } | 403 } |
404 | 404 |
405 // If this interstitial is shown on an existing navigation entry, we'll need | 405 // If this interstitial is shown on an existing navigation entry, we'll need |
406 // to remember its title so we can revert to it when hidden. | 406 // to remember its title so we can revert to it when hidden. |
407 if (!new_navigation_ && !should_revert_tab_title_) { | 407 if (!new_navigation_ && !should_revert_tab_title_) { |
408 original_tab_title_ = UTF16ToWideHack(entry->title()); | 408 original_tab_title_ = entry->title(); |
409 should_revert_tab_title_ = true; | 409 should_revert_tab_title_ = true; |
410 } | 410 } |
411 entry->set_title(title); | 411 entry->set_title(title); |
412 tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE); | 412 tab_->NotifyNavigationStateChanged(TabContents::INVALIDATE_TITLE); |
413 } | 413 } |
414 | 414 |
415 void InterstitialPage::DomOperationResponse(const std::string& json_string, | 415 void InterstitialPage::DomOperationResponse(const std::string& json_string, |
416 int automation_id) { | 416 int automation_id) { |
417 if (enabled_) | 417 if (enabled_) |
418 CommandReceived(json_string); | 418 CommandReceived(json_string); |
(...skipping 313 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
732 | 732 |
733 void InterstitialPage::UpdateInspectorSetting(const std::string& key, | 733 void InterstitialPage::UpdateInspectorSetting(const std::string& key, |
734 const std::string& value) { | 734 const std::string& value) { |
735 RenderViewHostDelegateHelper::UpdateInspectorSetting( | 735 RenderViewHostDelegateHelper::UpdateInspectorSetting( |
736 tab_->profile(), key, value); | 736 tab_->profile(), key, value); |
737 } | 737 } |
738 | 738 |
739 void InterstitialPage::ClearInspectorSettings() { | 739 void InterstitialPage::ClearInspectorSettings() { |
740 RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile()); | 740 RenderViewHostDelegateHelper::ClearInspectorSettings(tab_->profile()); |
741 } | 741 } |
OLD | NEW |