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

Side by Side Diff: chrome/browser/ui/webui/options/web_intents_settings_handler.cc

Issue 7930002: Rename WebIntentData for backend storage to WebIntentServiceData. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix class/struct decl Created 9 years, 3 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 unified diff | Download patch | Annotate | Revision Log
OLDNEW
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/webui/options/web_intents_settings_handler.h" 5 #include "chrome/browser/ui/webui/options/web_intents_settings_handler.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/browsing_data_appcache_helper.h" 9 #include "chrome/browser/browsing_data_appcache_helper.h"
10 #include "chrome/browser/browsing_data_database_helper.h" 10 #include "chrome/browser/browsing_data_database_helper.h"
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after
108 while (!node->empty()) { 108 while (!node->empty()) {
109 WebIntentsTreeNode* cnode = node->GetChild(0); 109 WebIntentsTreeNode* cnode = node->GetChild(0);
110 CHECK(cnode->Type() == WebIntentsTreeNode::TYPE_SERVICE); 110 CHECK(cnode->Type() == WebIntentsTreeNode::TYPE_SERVICE);
111 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(cnode); 111 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(cnode);
112 RemoveService(snode); 112 RemoveService(snode);
113 } 113 }
114 delete intents_tree_model_->Remove(node->parent(), node); 114 delete intents_tree_model_->Remove(node->parent(), node);
115 } 115 }
116 116
117 void WebIntentsSettingsHandler::RemoveService(ServiceTreeNode* snode) { 117 void WebIntentsSettingsHandler::RemoveService(ServiceTreeNode* snode) {
118 WebIntentData provider; 118 WebIntentServiceData service;
119 provider.service_url = GURL(snode->ServiceUrl()); 119 service.service_url = GURL(snode->ServiceUrl());
120 provider.action = snode->Action(); 120 service.action = snode->Action();
121 string16 stype; 121 string16 stype;
122 if (snode->Types().GetString(0, &stype)) { 122 if (snode->Types().GetString(0, &stype)) {
123 provider.type = stype; // Really need to iterate here. 123 service.type = stype; // Really need to iterate here.
124 } 124 }
125 provider.title = snode->ServiceName(); 125 service.title = snode->ServiceName();
126 LOG(INFO) << "Removing service " << snode->ServiceName() 126 LOG(INFO) << "Removing service " << snode->ServiceName()
127 << " " << snode->ServiceUrl(); 127 << " " << snode->ServiceUrl();
128 web_intents_registry_->UnregisterIntentProvider(provider); 128 web_intents_registry_->UnregisterIntentProvider(service);
129 delete intents_tree_model_->Remove(snode->parent(), snode); 129 delete intents_tree_model_->Remove(snode->parent(), snode);
130 } 130 }
131 131
132 void WebIntentsSettingsHandler::LoadChildren(const base::ListValue* args) { 132 void WebIntentsSettingsHandler::LoadChildren(const base::ListValue* args) {
133 EnsureWebIntentsModelCreated(); 133 EnsureWebIntentsModelCreated();
134 134
135 std::string node_path; 135 std::string node_path;
136 if (!args->GetString(0, &node_path)) { 136 if (!args->GetString(0, &node_path)) {
137 SendChildren(intents_tree_model_->GetRoot()); 137 SendChildren(intents_tree_model_->GetRoot());
138 return; 138 return;
(...skipping 13 matching lines...) Expand all
152 children); 152 children);
153 153
154 ListValue args; 154 ListValue args;
155 args.Append(parent == intents_tree_model_->GetRoot() ? 155 args.Append(parent == intents_tree_model_->GetRoot() ?
156 Value::CreateNullValue() : 156 Value::CreateNullValue() :
157 Value::CreateStringValue(intents_tree_model_->GetTreeNodeId(parent))); 157 Value::CreateStringValue(intents_tree_model_->GetTreeNodeId(parent)));
158 args.Append(children); 158 args.Append(children);
159 159
160 web_ui_->CallJavascriptFunction("IntentsView.loadChildren", args); 160 web_ui_->CallJavascriptFunction("IntentsView.loadChildren", args);
161 } 161 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/intents/web_intents_model_unittest.cc ('k') | chrome/browser/webdata/web_data_service.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698