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/ui/browser.h" | 5 #include "chrome/browser/ui/browser.h" |
6 | 6 |
7 #if defined(OS_WIN) | 7 #if defined(OS_WIN) |
8 #include <shellapi.h> | 8 #include <shellapi.h> |
9 #include <windows.h> | 9 #include <windows.h> |
10 #endif // OS_WIN | 10 #endif // OS_WIN |
(...skipping 4408 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4419 | 4419 |
4420 GURL view_source_url = GURL(chrome::kViewSourceScheme + std::string(":") + | 4420 GURL view_source_url = GURL(chrome::kViewSourceScheme + std::string(":") + |
4421 url.spec()); | 4421 url.spec()); |
4422 active_entry->set_virtual_url(view_source_url); | 4422 active_entry->set_virtual_url(view_source_url); |
4423 | 4423 |
4424 // Do not restore scroller position. | 4424 // Do not restore scroller position. |
4425 active_entry->set_content_state( | 4425 active_entry->set_content_state( |
4426 webkit_glue::RemoveScrollOffsetFromHistoryState(content_state)); | 4426 webkit_glue::RemoveScrollOffsetFromHistoryState(content_state)); |
4427 | 4427 |
4428 // Do not restore title, derive it from the url. | 4428 // Do not restore title, derive it from the url. |
4429 active_entry->set_title(base::i18n::String16WithDirection()); | 4429 active_entry->set_title(string16()); |
4430 | 4430 |
4431 // Now show view-source entry. | 4431 // Now show view-source entry. |
4432 if (CanSupportWindowFeature(FEATURE_TABSTRIP)) { | 4432 if (CanSupportWindowFeature(FEATURE_TABSTRIP)) { |
4433 // If this is a tabbed browser, just create a duplicate tab inside the same | 4433 // If this is a tabbed browser, just create a duplicate tab inside the same |
4434 // window next to the tab being duplicated. | 4434 // window next to the tab being duplicated. |
4435 int index = tab_handler_->GetTabStripModel()-> | 4435 int index = tab_handler_->GetTabStripModel()-> |
4436 GetIndexOfTabContents(contents); | 4436 GetIndexOfTabContents(contents); |
4437 int add_types = TabStripModel::ADD_ACTIVE | | 4437 int add_types = TabStripModel::ADD_ACTIVE | |
4438 TabStripModel::ADD_INHERIT_GROUP; | 4438 TabStripModel::ADD_INHERIT_GROUP; |
4439 tab_handler_->GetTabStripModel()->InsertTabContentsAt(index + 1, | 4439 tab_handler_->GetTabStripModel()->InsertTabContentsAt(index + 1, |
(...skipping 28 matching lines...) Expand all Loading... |
4468 TabContents* current_tab = GetSelectedTabContents(); | 4468 TabContents* current_tab = GetSelectedTabContents(); |
4469 if (current_tab) { | 4469 if (current_tab) { |
4470 content_restrictions = current_tab->content_restrictions(); | 4470 content_restrictions = current_tab->content_restrictions(); |
4471 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); | 4471 NavigationEntry* active_entry = current_tab->controller().GetActiveEntry(); |
4472 // See comment in UpdateCommandsForTabState about why we call url(). | 4472 // See comment in UpdateCommandsForTabState about why we call url(). |
4473 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) | 4473 if (!SavePackage::IsSavableURL(active_entry ? active_entry->url() : GURL())) |
4474 content_restrictions |= CONTENT_RESTRICTION_SAVE; | 4474 content_restrictions |= CONTENT_RESTRICTION_SAVE; |
4475 } | 4475 } |
4476 return content_restrictions; | 4476 return content_restrictions; |
4477 } | 4477 } |
OLD | NEW |