| OLD | NEW |
| 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/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/utf_string_conversions.h" | 8 #include "base/utf_string_conversions.h" |
| 9 #include "base/values.h" | 9 #include "base/values.h" |
| 10 #include "chrome/browser/browsing_data_appcache_helper.h" | 10 #include "chrome/browser/browsing_data_appcache_helper.h" |
| (...skipping 98 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 109 while (!node->empty()) { | 109 while (!node->empty()) { |
| 110 WebIntentsTreeNode* cnode = node->GetChild(0); | 110 WebIntentsTreeNode* cnode = node->GetChild(0); |
| 111 CHECK(cnode->Type() == WebIntentsTreeNode::TYPE_SERVICE); | 111 CHECK(cnode->Type() == WebIntentsTreeNode::TYPE_SERVICE); |
| 112 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(cnode); | 112 ServiceTreeNode* snode = static_cast<ServiceTreeNode*>(cnode); |
| 113 RemoveService(snode); | 113 RemoveService(snode); |
| 114 } | 114 } |
| 115 delete intents_tree_model_->Remove(node->parent(), node); | 115 delete intents_tree_model_->Remove(node->parent(), node); |
| 116 } | 116 } |
| 117 | 117 |
| 118 void WebIntentsSettingsHandler::RemoveService(ServiceTreeNode* snode) { | 118 void WebIntentsSettingsHandler::RemoveService(ServiceTreeNode* snode) { |
| 119 WebIntentServiceData service; | 119 webkit_glue::WebIntentServiceData service; |
| 120 service.service_url = GURL(snode->ServiceUrl()); | 120 service.service_url = GURL(snode->ServiceUrl()); |
| 121 service.action = snode->Action(); | 121 service.action = snode->Action(); |
| 122 string16 stype; | 122 string16 stype; |
| 123 if (snode->Types().GetString(0, &stype)) { | 123 if (snode->Types().GetString(0, &stype)) { |
| 124 service.type = stype; // Really need to iterate here. | 124 service.type = stype; // Really need to iterate here. |
| 125 } | 125 } |
| 126 service.title = snode->ServiceName(); | 126 service.title = snode->ServiceName(); |
| 127 LOG(INFO) << "Removing service " << snode->ServiceName() | 127 LOG(INFO) << "Removing service " << snode->ServiceName() |
| 128 << " " << snode->ServiceUrl(); | 128 << " " << snode->ServiceUrl(); |
| 129 web_intents_registry_->UnregisterIntentProvider(service); | 129 web_intents_registry_->UnregisterIntentProvider(service); |
| (...skipping 23 matching lines...) Expand all Loading... |
| 153 children); | 153 children); |
| 154 | 154 |
| 155 ListValue args; | 155 ListValue args; |
| 156 args.Append(parent == intents_tree_model_->GetRoot() ? | 156 args.Append(parent == intents_tree_model_->GetRoot() ? |
| 157 Value::CreateNullValue() : | 157 Value::CreateNullValue() : |
| 158 Value::CreateStringValue(intents_tree_model_->GetTreeNodeId(parent))); | 158 Value::CreateStringValue(intents_tree_model_->GetTreeNodeId(parent))); |
| 159 args.Append(children); | 159 args.Append(children); |
| 160 | 160 |
| 161 web_ui_->CallJavascriptFunction("IntentsView.loadChildren", args); | 161 web_ui_->CallJavascriptFunction("IntentsView.loadChildren", args); |
| 162 } | 162 } |
| OLD | NEW |