| 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/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" |
| 11 #include "base/memory/ref_counted.h" | 11 #include "base/memory/ref_counted.h" |
| 12 #include "base/task.h" | 12 #include "base/task.h" |
| 13 #include "base/tracked_objects.h" | 13 #include "base/tracked_objects.h" |
| 14 #include "base/values.h" | 14 #include "base/values.h" |
| 15 #include "chrome/browser/profiles/profile.h" | 15 #include "chrome/browser/profiles/profile.h" |
| 16 #include "chrome/browser/sync/js/js_arg_list.h" | 16 #include "chrome/browser/sync/js/js_arg_list.h" |
| 17 #include "chrome/browser/sync/js/js_controller.h" | 17 #include "chrome/browser/sync/js/js_controller.h" |
| 18 #include "chrome/browser/sync/js/js_event_details.h" | 18 #include "chrome/browser/sync/js/js_event_details.h" |
| 19 #include "chrome/browser/sync/profile_sync_service.h" | 19 #include "chrome/browser/sync/profile_sync_service.h" |
| 20 #include "chrome/browser/sync/sync_ui_util.h" | 20 #include "chrome/browser/sync/sync_ui_util.h" |
| 21 #include "chrome/browser/sync/util/weak_handle.h" | 21 #include "chrome/browser/sync/util/weak_handle.h" |
| 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" | 22 #include "chrome/browser/ui/tab_contents/tab_contents_wrapper.h" |
| 23 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" | 23 #include "chrome/browser/ui/webui/chrome_url_data_manager.h" |
| 24 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" | 24 #include "chrome/browser/ui/webui/chrome_web_ui_data_source.h" |
| 25 #include "chrome/common/extensions/extension_messages.h" | 25 #include "chrome/common/extensions/extension_messages.h" |
| 26 #include "chrome/common/url_constants.h" | 26 #include "chrome/common/url_constants.h" |
| 27 #include "content/browser/tab_contents/tab_contents.h" |
| 27 #include "grit/sync_internals_resources.h" | 28 #include "grit/sync_internals_resources.h" |
| 28 #include "ui/base/resource/resource_bundle.h" | 29 #include "ui/base/resource/resource_bundle.h" |
| 29 | 30 |
| 30 namespace { | 31 namespace { |
| 31 | 32 |
| 32 ChromeWebUIDataSource* CreateSyncInternalsHTMLSource() { | 33 ChromeWebUIDataSource* CreateSyncInternalsHTMLSource() { |
| 33 ChromeWebUIDataSource* source = | 34 ChromeWebUIDataSource* source = |
| 34 new ChromeWebUIDataSource(chrome::kChromeUISyncInternalsHost); | 35 new ChromeWebUIDataSource(chrome::kChromeUISyncInternalsHost); |
| 35 | 36 |
| 36 source->set_json_path("strings.js"); | 37 source->set_json_path("strings.js"); |
| (...skipping 94 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 131 } | 132 } |
| 132 | 133 |
| 133 void SyncInternalsUI::HandleJsReply( | 134 void SyncInternalsUI::HandleJsReply( |
| 134 const std::string& name, const JsArgList& args) { | 135 const std::string& name, const JsArgList& args) { |
| 135 VLOG(1) << "Handling reply for " << name << " message with args " | 136 VLOG(1) << "Handling reply for " << name << " message with args " |
| 136 << args.ToString(); | 137 << args.ToString(); |
| 137 const std::string& reply_handler = "chrome.sync." + name + ".handleReply"; | 138 const std::string& reply_handler = "chrome.sync." + name + ".handleReply"; |
| 138 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); | 139 std::vector<const Value*> arg_list(args.Get().begin(), args.Get().end()); |
| 139 CallJavascriptFunction(reply_handler, arg_list); | 140 CallJavascriptFunction(reply_handler, arg_list); |
| 140 } | 141 } |
| OLD | NEW |