OLD | NEW |
1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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/devtools/devtools_ui_bindings.h" | 5 #include "chrome/browser/devtools/devtools_ui_bindings.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
| 8 #include <utility> |
8 | 9 |
9 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
10 #include "base/json/json_writer.h" | 11 #include "base/json/json_writer.h" |
11 #include "base/macros.h" | 12 #include "base/macros.h" |
12 #include "base/metrics/histogram.h" | 13 #include "base/metrics/histogram.h" |
13 #include "base/prefs/scoped_user_pref_update.h" | 14 #include "base/prefs/scoped_user_pref_update.h" |
14 #include "base/strings/string_number_conversions.h" | 15 #include "base/strings/string_number_conversions.h" |
15 #include "base/strings/string_util.h" | 16 #include "base/strings/string_util.h" |
16 #include "base/strings/stringprintf.h" | 17 #include "base/strings/stringprintf.h" |
17 #include "base/strings/utf_string_conversions.h" | 18 #include "base/strings/utf_string_conversions.h" |
(...skipping 1068 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1086 | 1087 |
1087 void DevToolsUIBindings::ShowDevToolsConfirmInfoBar( | 1088 void DevToolsUIBindings::ShowDevToolsConfirmInfoBar( |
1088 const base::string16& message, | 1089 const base::string16& message, |
1089 const InfoBarCallback& callback) { | 1090 const InfoBarCallback& callback) { |
1090 if (!delegate_->GetInfoBarService()) { | 1091 if (!delegate_->GetInfoBarService()) { |
1091 callback.Run(false); | 1092 callback.Run(false); |
1092 return; | 1093 return; |
1093 } | 1094 } |
1094 scoped_ptr<DevToolsConfirmInfoBarDelegate> delegate( | 1095 scoped_ptr<DevToolsConfirmInfoBarDelegate> delegate( |
1095 new DevToolsConfirmInfoBarDelegate(callback, message)); | 1096 new DevToolsConfirmInfoBarDelegate(callback, message)); |
1096 GlobalConfirmInfoBar::Show(delegate.Pass()); | 1097 GlobalConfirmInfoBar::Show(std::move(delegate)); |
1097 } | 1098 } |
1098 | 1099 |
1099 void DevToolsUIBindings::AddDevToolsExtensionsToClient() { | 1100 void DevToolsUIBindings::AddDevToolsExtensionsToClient() { |
1100 const extensions::ExtensionRegistry* registry = | 1101 const extensions::ExtensionRegistry* registry = |
1101 extensions::ExtensionRegistry::Get(profile_->GetOriginalProfile()); | 1102 extensions::ExtensionRegistry::Get(profile_->GetOriginalProfile()); |
1102 if (!registry) | 1103 if (!registry) |
1103 return; | 1104 return; |
1104 | 1105 |
1105 base::ListValue results; | 1106 base::ListValue results; |
1106 for (const scoped_refptr<const extensions::Extension>& extension : | 1107 for (const scoped_refptr<const extensions::Extension>& extension : |
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1210 return; | 1211 return; |
1211 frontend_loaded_ = true; | 1212 frontend_loaded_ = true; |
1212 | 1213 |
1213 // Call delegate first - it seeds importants bit of information. | 1214 // Call delegate first - it seeds importants bit of information. |
1214 delegate_->OnLoadCompleted(); | 1215 delegate_->OnLoadCompleted(); |
1215 | 1216 |
1216 AddDevToolsExtensionsToClient(); | 1217 AddDevToolsExtensionsToClient(); |
1217 if (g_web_socket_api_channel) | 1218 if (g_web_socket_api_channel) |
1218 g_web_socket_api_channel->AttachedToBindings(this); | 1219 g_web_socket_api_channel->AttachedToBindings(this); |
1219 } | 1220 } |
OLD | NEW |