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

Unified Diff: chrome/browser/ui/webui/options2/cookies_view_handler2.cc

Issue 10703127: Merge 145197 - clean-up: Use an id instead of memory pointer string in webui. (Closed) Base URL: svn://svn.chromium.org/chrome/branches/1180/src/
Patch Set: Created 8 years, 5 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/ui/webui/options2/cookies_view_handler2.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/webui/options2/cookies_view_handler2.cc
===================================================================
--- chrome/browser/ui/webui/options2/cookies_view_handler2.cc (revision 145933)
+++ chrome/browser/ui/webui/options2/cookies_view_handler2.cc (working copy)
@@ -4,6 +4,8 @@
#include "chrome/browser/ui/webui/options2/cookies_view_handler2.h"
+#include <string>
+
#include "base/bind.h"
#include "base/bind_helpers.h"
#include "base/utf_string_conversions.h"
@@ -24,7 +26,9 @@
namespace options2 {
-CookiesViewHandler::CookiesViewHandler() : batch_update_(false) {
+CookiesViewHandler::CookiesViewHandler()
+ : batch_update_(false),
+ model_util_(new CookiesTreeModelUtil) {
}
CookiesViewHandler::~CookiesViewHandler() {
@@ -116,14 +120,14 @@
CookieTreeNode* parent_node = cookies_tree_model_->AsNode(parent);
ListValue* children = new ListValue;
- cookies_tree_model_util::GetChildNodeList(parent_node, start, count,
+ model_util_->GetChildNodeList(parent_node, start, count,
children);
ListValue args;
args.Append(parent == cookies_tree_model_->GetRoot() ?
Value::CreateNullValue() :
Value::CreateStringValue(
- cookies_tree_model_util::GetTreeNodeId(parent_node)));
+ model_util_->GetTreeNodeId(parent_node)));
args.Append(Value::CreateIntegerValue(start));
args.Append(children);
web_ui()->CallJavascriptFunction("CookiesView.onTreeItemAdded", args);
@@ -140,7 +144,7 @@
ListValue args;
args.Append(parent == cookies_tree_model_->GetRoot() ?
Value::CreateNullValue() :
- Value::CreateStringValue(cookies_tree_model_util::GetTreeNodeId(
+ Value::CreateStringValue(model_util_->GetTreeNodeId(
cookies_tree_model_->AsNode(parent))));
args.Append(Value::CreateIntegerValue(start));
args.Append(Value::CreateIntegerValue(count));
@@ -201,10 +205,10 @@
EnsureCookiesTreeModelCreated();
- CookieTreeNode* node = cookies_tree_model_util::GetTreeNodeFromPath(
+ const CookieTreeNode* node = model_util_->GetTreeNodeFromPath(
cookies_tree_model_->GetRoot(), node_path);
if (node)
- cookies_tree_model_->DeleteCookieNode(node);
+ cookies_tree_model_->DeleteCookieNode(const_cast<CookieTreeNode*>(node));
}
void CookiesViewHandler::LoadChildren(const ListValue* args) {
@@ -215,21 +219,21 @@
EnsureCookiesTreeModelCreated();
- CookieTreeNode* node = cookies_tree_model_util::GetTreeNodeFromPath(
+ const CookieTreeNode* node = model_util_->GetTreeNodeFromPath(
cookies_tree_model_->GetRoot(), node_path);
if (node)
SendChildren(node);
}
-void CookiesViewHandler::SendChildren(CookieTreeNode* parent) {
+void CookiesViewHandler::SendChildren(const CookieTreeNode* parent) {
ListValue* children = new ListValue;
- cookies_tree_model_util::GetChildNodeList(parent, 0, parent->child_count(),
+ model_util_->GetChildNodeList(parent, 0, parent->child_count(),
children);
ListValue args;
args.Append(parent == cookies_tree_model_->GetRoot() ?
Value::CreateNullValue() :
- Value::CreateStringValue(cookies_tree_model_util::GetTreeNodeId(parent)));
+ Value::CreateStringValue(model_util_->GetTreeNodeId(parent)));
args.Append(children);
web_ui()->CallJavascriptFunction("CookiesView.loadChildren", args);
« no previous file with comments | « chrome/browser/ui/webui/options2/cookies_view_handler2.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698