| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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/sync_internals_ui.h" | 5 #include "chrome/browser/ui/webui/sync_internals_ui.h" |
| 6 | 6 |
| 7 #include <string> | 7 #include <string> |
| 8 #include <vector> | 8 #include <vector> |
| 9 | 9 |
| 10 #include "base/logging.h" | 10 #include "base/logging.h" |
| (...skipping 11 matching lines...) Expand all Loading... |
| 22 #include "chrome/common/url_constants.h" | 22 #include "chrome/common/url_constants.h" |
| 23 #include "content/public/browser/web_contents.h" | 23 #include "content/public/browser/web_contents.h" |
| 24 #include "content/public/browser/web_ui.h" | 24 #include "content/public/browser/web_ui.h" |
| 25 #include "grit/sync_internals_resources.h" | 25 #include "grit/sync_internals_resources.h" |
| 26 #include "sync/internal_api/public/util/weak_handle.h" | 26 #include "sync/internal_api/public/util/weak_handle.h" |
| 27 #include "sync/js/js_arg_list.h" | 27 #include "sync/js/js_arg_list.h" |
| 28 #include "sync/js/js_controller.h" | 28 #include "sync/js/js_controller.h" |
| 29 #include "sync/js/js_event_details.h" | 29 #include "sync/js/js_event_details.h" |
| 30 #include "ui/base/resource/resource_bundle.h" | 30 #include "ui/base/resource/resource_bundle.h" |
| 31 | 31 |
| 32 using csync::JsArgList; | 32 using syncer::JsArgList; |
| 33 using csync::JsEventDetails; | 33 using syncer::JsEventDetails; |
| 34 using csync::JsReplyHandler; | 34 using syncer::JsReplyHandler; |
| 35 using csync::WeakHandle; | 35 using syncer::WeakHandle; |
| 36 using content::WebContents; | 36 using content::WebContents; |
| 37 | 37 |
| 38 namespace { | 38 namespace { |
| 39 | 39 |
| 40 ChromeWebUIDataSource* CreateSyncInternalsHTMLSource() { | 40 ChromeWebUIDataSource* CreateSyncInternalsHTMLSource() { |
| 41 ChromeWebUIDataSource* source = | 41 ChromeWebUIDataSource* source = |
| 42 new ChromeWebUIDataSource(chrome::kChromeUISyncInternalsHost); | 42 new ChromeWebUIDataSource(chrome::kChromeUISyncInternalsHost); |
| 43 | 43 |
| 44 source->set_json_path("strings.js"); | 44 source->set_json_path("strings.js"); |
| 45 source->add_resource_path("sync_index.js", IDR_SYNC_INTERNALS_INDEX_JS); | 45 source->add_resource_path("sync_index.js", IDR_SYNC_INTERNALS_INDEX_JS); |
| (...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 138 } | 138 } |
| 139 | 139 |
| 140 void SyncInternalsUI::HandleJsReply( | 140 void SyncInternalsUI::HandleJsReply( |
| 141 const std::string& name, const JsArgList& args) { | 141 const std::string& name, const JsArgList& args) { |
| 142 VLOG(1) << "Handling reply for " << name << " message with args " | 142 VLOG(1) << "Handling reply for " << name << " message with args " |
| 143 << args.ToString(); | 143 << args.ToString(); |
| 144 const std::string& reply_handler = "chrome.sync." + name + ".handleReply"; | 144 const std::string& reply_handler = "chrome.sync." + name + ".handleReply"; |
| 145 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); | 145 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); |
| 146 web_ui()->CallJavascriptFunction(reply_handler, arg_list); | 146 web_ui()->CallJavascriptFunction(reply_handler, arg_list); |
| 147 } | 147 } |
| OLD | NEW |