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 <algorithm> | 5 #include <algorithm> |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
9 #include "base/lazy_instance.h" | 9 #include "base/lazy_instance.h" |
10 #include "base/string_number_conversions.h" | 10 #include "base/string_number_conversions.h" |
(...skipping 44 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
55 using content::DevToolsAgentHost; | 55 using content::DevToolsAgentHost; |
56 using content::DevToolsAgentHostRegistry; | 56 using content::DevToolsAgentHostRegistry; |
57 using content::DevToolsClientHost; | 57 using content::DevToolsClientHost; |
58 using content::DevToolsManager; | 58 using content::DevToolsManager; |
59 using content::NativeWebKeyboardEvent; | 59 using content::NativeWebKeyboardEvent; |
60 using content::NavigationController; | 60 using content::NavigationController; |
61 using content::NavigationEntry; | 61 using content::NavigationEntry; |
62 using content::OpenURLParams; | 62 using content::OpenURLParams; |
63 using content::RenderViewHost; | 63 using content::RenderViewHost; |
64 using content::WebContents; | 64 using content::WebContents; |
| 65 using extensions::APIPermission; |
65 | 66 |
66 const char DevToolsWindow::kDevToolsApp[] = "DevToolsApp"; | 67 const char DevToolsWindow::kDevToolsApp[] = "DevToolsApp"; |
67 | 68 |
68 const char kDockSideBottom[] = "bottom"; | 69 const char kDockSideBottom[] = "bottom"; |
69 const char kDockSideRight[] = "right"; | 70 const char kDockSideRight[] = "right"; |
70 | 71 |
71 // static | 72 // static |
72 void DevToolsWindow::RegisterUserPrefs(PrefService* prefs) { | 73 void DevToolsWindow::RegisterUserPrefs(PrefService* prefs) { |
73 prefs->RegisterBooleanPref(prefs::kDevToolsOpenDocked, | 74 prefs->RegisterBooleanPref(prefs::kDevToolsOpenDocked, |
74 true, | 75 true, |
(...skipping 365 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 | 441 |
441 for (ExtensionSet::const_iterator extension = extensions->begin(); | 442 for (ExtensionSet::const_iterator extension = extensions->begin(); |
442 extension != extensions->end(); ++extension) { | 443 extension != extensions->end(); ++extension) { |
443 if ((*extension)->devtools_url().is_empty()) | 444 if ((*extension)->devtools_url().is_empty()) |
444 continue; | 445 continue; |
445 DictionaryValue* extension_info = new DictionaryValue(); | 446 DictionaryValue* extension_info = new DictionaryValue(); |
446 extension_info->Set("startPage", | 447 extension_info->Set("startPage", |
447 new StringValue((*extension)->devtools_url().spec())); | 448 new StringValue((*extension)->devtools_url().spec())); |
448 extension_info->Set("name", new StringValue((*extension)->name())); | 449 extension_info->Set("name", new StringValue((*extension)->name())); |
449 bool allow_experimental = (*extension)->HasAPIPermission( | 450 bool allow_experimental = (*extension)->HasAPIPermission( |
450 ExtensionAPIPermission::kExperimental); | 451 APIPermission::kExperimental); |
451 extension_info->Set("exposeExperimentalAPIs", | 452 extension_info->Set("exposeExperimentalAPIs", |
452 new base::FundamentalValue(allow_experimental)); | 453 new base::FundamentalValue(allow_experimental)); |
453 results.Append(extension_info); | 454 results.Append(extension_info); |
454 } | 455 } |
455 CallClientFunction("WebInspector.addExtensions", &results); | 456 CallClientFunction("WebInspector.addExtensions", &results); |
456 } | 457 } |
457 | 458 |
458 WebContents* DevToolsWindow::OpenURLFromTab(WebContents* source, | 459 WebContents* DevToolsWindow::OpenURLFromTab(WebContents* source, |
459 const OpenURLParams& params) { | 460 const OpenURLParams& params) { |
460 if (inspected_tab_) | 461 if (inspected_tab_) |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
745 CallClientFunction("InspectorFrontendAPI.appendedToURL", &url_value); | 746 CallClientFunction("InspectorFrontendAPI.appendedToURL", &url_value); |
746 } | 747 } |
747 | 748 |
748 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { | 749 content::JavaScriptDialogCreator* DevToolsWindow::GetJavaScriptDialogCreator() { |
749 if (inspected_tab_ && inspected_tab_->web_contents()->GetDelegate()) { | 750 if (inspected_tab_ && inspected_tab_->web_contents()->GetDelegate()) { |
750 return inspected_tab_->web_contents()->GetDelegate()-> | 751 return inspected_tab_->web_contents()->GetDelegate()-> |
751 GetJavaScriptDialogCreator(); | 752 GetJavaScriptDialogCreator(); |
752 } | 753 } |
753 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); | 754 return content::WebContentsDelegate::GetJavaScriptDialogCreator(); |
754 } | 755 } |
OLD | NEW |