| OLD | NEW |
| 1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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/dom_ui/options/cookies_view_handler.h" | 5 #include "chrome/browser/dom_ui/options/cookies_view_handler.h" |
| 6 | 6 |
| 7 #include "app/l10n_util.h" | 7 #include "app/l10n_util.h" |
| 8 #include "base/i18n/time_formatting.h" | 8 #include "base/i18n/time_formatting.h" |
| 9 #include "base/string_number_conversions.h" | 9 #include "base/string_number_conversions.h" |
| 10 #include "base/string_split.h" | 10 #include "base/string_split.h" |
| (...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 363 } | 363 } |
| 364 | 364 |
| 365 CookieTreeNode* node = GetTreeNodeFromPath(node_path); | 365 CookieTreeNode* node = GetTreeNodeFromPath(node_path); |
| 366 if (node) | 366 if (node) |
| 367 SendChildren(node); | 367 SendChildren(node); |
| 368 } | 368 } |
| 369 | 369 |
| 370 CookieTreeNode* CookiesViewHandler::GetTreeNodeFromPath( | 370 CookieTreeNode* CookiesViewHandler::GetTreeNodeFromPath( |
| 371 const std::string& path) { | 371 const std::string& path) { |
| 372 std::vector<std::string> node_ids; | 372 std::vector<std::string> node_ids; |
| 373 SplitString(path, ',', &node_ids); | 373 base::SplitString(path, ',', &node_ids); |
| 374 | 374 |
| 375 CookieTreeNode* child = NULL; | 375 CookieTreeNode* child = NULL; |
| 376 CookieTreeNode* parent = cookies_tree_model_->GetRoot(); | 376 CookieTreeNode* parent = cookies_tree_model_->GetRoot(); |
| 377 int child_index = -1; | 377 int child_index = -1; |
| 378 | 378 |
| 379 // Validate the tree path and get the node pointer. | 379 // Validate the tree path and get the node pointer. |
| 380 for (size_t i = 0; i < node_ids.size(); ++i) { | 380 for (size_t i = 0; i < node_ids.size(); ++i) { |
| 381 child = reinterpret_cast<CookieTreeNode*>( | 381 child = reinterpret_cast<CookieTreeNode*>( |
| 382 HexStringToPointer(node_ids[i])); | 382 HexStringToPointer(node_ids[i])); |
| 383 | 383 |
| (...skipping 12 matching lines...) Expand all Loading... |
| 396 GetChildNodeList(parent, 0, parent->GetChildCount(), children); | 396 GetChildNodeList(parent, 0, parent->GetChildCount(), children); |
| 397 | 397 |
| 398 ListValue args; | 398 ListValue args; |
| 399 args.Append(parent == cookies_tree_model_->GetRoot() ? | 399 args.Append(parent == cookies_tree_model_->GetRoot() ? |
| 400 Value::CreateNullValue() : | 400 Value::CreateNullValue() : |
| 401 Value::CreateStringValue(PointerToHexString(parent))); | 401 Value::CreateStringValue(PointerToHexString(parent))); |
| 402 args.Append(children); | 402 args.Append(children); |
| 403 | 403 |
| 404 dom_ui_->CallJavascriptFunction(L"CookiesView.loadChildren", args); | 404 dom_ui_->CallJavascriptFunction(L"CookiesView.loadChildren", args); |
| 405 } | 405 } |
| OLD | NEW |