| 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 "build/build_config.h" | 5 #include "build/build_config.h" |
| 6 | 6 |
| 7 #include "chrome/browser/dom_ui/new_tab_ui.h" | 7 #include "chrome/browser/dom_ui/new_tab_ui.h" |
| 8 | 8 |
| 9 #include "base/histogram.h" | 9 #include "base/histogram.h" |
| 10 #include "base/string_piece.h" | 10 #include "base/string_piece.h" |
| (...skipping 578 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 589 // strings. | 589 // strings. |
| 590 if (content->GetType() == Value::TYPE_LIST) { | 590 if (content->GetType() == Value::TYPE_LIST) { |
| 591 const ListValue* list_value = static_cast<const ListValue*>(content); | 591 const ListValue* list_value = static_cast<const ListValue*>(content); |
| 592 Value* list_member; | 592 Value* list_member; |
| 593 if (list_value->Get(0, &list_member) && | 593 if (list_value->Get(0, &list_member) && |
| 594 list_member->GetType() == Value::TYPE_STRING) { | 594 list_member->GetType() == Value::TYPE_STRING) { |
| 595 const StringValue* string_value = | 595 const StringValue* string_value = |
| 596 static_cast<const StringValue*>(list_member); | 596 static_cast<const StringValue*>(list_member); |
| 597 std::wstring wstring_value; | 597 std::wstring wstring_value; |
| 598 if (string_value->GetAsString(&wstring_value)) { | 598 if (string_value->GetAsString(&wstring_value)) { |
| 599 int session_to_restore = StringToInt(wstring_value); | 599 int session_to_restore = StringToInt(WideToUTF16Hack(wstring_value)); |
| 600 tab_restore_service_->RestoreEntryById(browser, session_to_restore, | 600 tab_restore_service_->RestoreEntryById(browser, session_to_restore, |
| 601 true); | 601 true); |
| 602 // The current tab has been nuked at this point; don't touch any member | 602 // The current tab has been nuked at this point; don't touch any member |
| 603 // variables. | 603 // variables. |
| 604 } | 604 } |
| 605 } | 605 } |
| 606 } | 606 } |
| 607 } | 607 } |
| 608 | 608 |
| 609 void RecentlyClosedTabsHandler::HandleGetRecentlyClosedTabs( | 609 void RecentlyClosedTabsHandler::HandleGetRecentlyClosedTabs( |
| (...skipping 265 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 875 const GURL&, | 875 const GURL&, |
| 876 WindowOpenDisposition disposition) { | 876 WindowOpenDisposition disposition) { |
| 877 // The user opened a URL on the page (including "open in new window"). | 877 // The user opened a URL on the page (including "open in new window"). |
| 878 // We count all such clicks as AUTO_BOOKMARK, which increments the site's | 878 // We count all such clicks as AUTO_BOOKMARK, which increments the site's |
| 879 // visit count (which is used for ranking the most visited entries). | 879 // visit count (which is used for ranking the most visited entries). |
| 880 // Note this means we're including clicks on not only most visited | 880 // Note this means we're including clicks on not only most visited |
| 881 // thumbnails, but also clicks on recently bookmarked. | 881 // thumbnails, but also clicks on recently bookmarked. |
| 882 get_contents()->OpenURL(url, GURL(), disposition, | 882 get_contents()->OpenURL(url, GURL(), disposition, |
| 883 PageTransition::AUTO_BOOKMARK); | 883 PageTransition::AUTO_BOOKMARK); |
| 884 } | 884 } |
| OLD | NEW |