| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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/ssl_blocking_page.h" | 5 #include "chrome/browser/ssl_blocking_page.h" |
| 6 | 6 |
| 7 #include "base/string_piece.h" | 7 #include "base/string_piece.h" |
| 8 #include "chrome/browser/browser.h" | 8 #include "chrome/browser/browser.h" |
| 9 #include "chrome/browser/browser_resources.h" | 9 #include "chrome/browser/browser_resources.h" |
| 10 #include "chrome/browser/cert_store.h" | 10 #include "chrome/browser/cert_store.h" |
| (...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 164 const NotificationSource& source, | 164 const NotificationSource& source, |
| 165 const NotificationDetails& details) { | 165 const NotificationDetails& details) { |
| 166 switch (type) { | 166 switch (type) { |
| 167 case NOTIFY_TAB_CLOSING: | 167 case NOTIFY_TAB_CLOSING: |
| 168 case NOTIFY_INTERSTITIAL_PAGE_CLOSED: { | 168 case NOTIFY_INTERSTITIAL_PAGE_CLOSED: { |
| 169 // We created a navigation entry for the interstitial, remove it. | 169 // We created a navigation entry for the interstitial, remove it. |
| 170 // Note that we don't remove the entry if we are closing all tabs so that | 170 // Note that we don't remove the entry if we are closing all tabs so that |
| 171 // the last entry is kept for the restoring on next start-up. | 171 // the last entry is kept for the restoring on next start-up. |
| 172 Browser* browser = Browser::GetBrowserForController(tab_->controller(), | 172 Browser* browser = Browser::GetBrowserForController(tab_->controller(), |
| 173 NULL); | 173 NULL); |
| 174 if (remove_last_entry_ && | 174 // We may not have a browser (this is the case for constrained popups), in |
| 175 // which case it does not matter if we do not remove the temporary entry |
| 176 // as their navigation history is not saved. |
| 177 if (remove_last_entry_ && browser && |
| 175 !browser->tabstrip_model()->closing_all()) { | 178 !browser->tabstrip_model()->closing_all()) { |
| 176 tab_->controller()->RemoveLastEntry(); | 179 tab_->controller()->RemoveLastEntry(); |
| 177 } | 180 } |
| 178 delete this; | 181 delete this; |
| 179 break; | 182 break; |
| 180 } | 183 } |
| 181 case NOTIFY_DOM_OPERATION_RESPONSE: { | 184 case NOTIFY_DOM_OPERATION_RESPONSE: { |
| 182 std::string json = | 185 std::string json = |
| 183 Details<DomOperationNotificationDetails>(details)->json(); | 186 Details<DomOperationNotificationDetails>(details)->json(); |
| 184 if (json == "1") { | 187 if (json == "1") { |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 283 }; | 286 }; |
| 284 int i; | 287 int i; |
| 285 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { | 288 for (i = 0; i < static_cast<int>(extra_info.size()); i++) { |
| 286 strings->SetString(keys[i], extra_info[i]); | 289 strings->SetString(keys[i], extra_info[i]); |
| 287 } | 290 } |
| 288 for (;i < 5; i++) { | 291 for (;i < 5; i++) { |
| 289 strings->SetString(keys[i], L""); | 292 strings->SetString(keys[i], L""); |
| 290 } | 293 } |
| 291 } | 294 } |
| 292 | 295 |
| OLD | NEW |