Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(5454)

Unified Diff: chrome/browser/dom_ui/value_helper.cc

Issue 3127017: Revert 56423 - Added classes to enable session sync functionality.... (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 10 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/dom_ui/value_helper.h ('k') | chrome/browser/sessions/session_restore.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/dom_ui/value_helper.cc
===================================================================
--- chrome/browser/dom_ui/value_helper.cc (revision 56425)
+++ chrome/browser/dom_ui/value_helper.cc (working copy)
@@ -1,47 +0,0 @@
-// Copyright (c) 2010 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/browser/dom_ui/value_helper.h"
-
-#include "chrome/browser/dom_ui/new_tab_ui.h"
-#include "chrome/common/url_constants.h"
-
-bool ValueHelper::TabToValue(
- const TabRestoreService::Tab& tab,
- DictionaryValue* dictionary) {
- if (tab.navigations.empty())
- return false;
-
- const TabNavigation& current_navigation =
- tab.navigations.at(tab.current_navigation_index);
- if (current_navigation.virtual_url() == GURL(chrome::kChromeUINewTabURL))
- return false;
- NewTabUI::SetURLTitleAndDirection(dictionary, current_navigation.title(),
- current_navigation.virtual_url());
- dictionary->SetString(L"type", L"tab");
- dictionary->SetReal(L"timestamp", tab.timestamp.ToDoubleT());
- return true;
-}
-
-bool ValueHelper::WindowToValue(
- const TabRestoreService::Window& window,
- DictionaryValue* dictionary) {
- if (window.tabs.empty()) {
- NOTREACHED();
- return false;
- }
- scoped_ptr<ListValue> tab_values(new ListValue());
- for (size_t i = 0; i < window.tabs.size(); ++i) {
- scoped_ptr<DictionaryValue> tab_value(new DictionaryValue());
- if (TabToValue(window.tabs[i], tab_value.get()))
- tab_values->Append(tab_value.release());
- }
- if (tab_values->GetSize() == 0)
- return false;
- dictionary->SetString(L"type", L"window");
- dictionary->SetReal(L"timestamp", window.timestamp.ToDoubleT());
- dictionary->Set(L"tabs", tab_values.release());
- return true;
-}
-
« no previous file with comments | « chrome/browser/dom_ui/value_helper.h ('k') | chrome/browser/sessions/session_restore.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698