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 "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/json/json_reader.h" | 8 #include "base/json/json_reader.h" |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/strings/string_number_conversions.h" | 10 #include "base/strings/string_number_conversions.h" |
(...skipping 25 matching lines...) Expand all Loading... |
36 #include "content/public/browser/favicon_status.h" | 36 #include "content/public/browser/favicon_status.h" |
37 #include "content/public/browser/invalidate_type.h" | 37 #include "content/public/browser/invalidate_type.h" |
38 #include "content/public/browser/navigation_controller.h" | 38 #include "content/public/browser/navigation_controller.h" |
39 #include "content/public/browser/navigation_entry.h" | 39 #include "content/public/browser/navigation_entry.h" |
40 #include "content/public/browser/notification_source.h" | 40 #include "content/public/browser/notification_source.h" |
41 #include "content/public/browser/render_frame_host.h" | 41 #include "content/public/browser/render_frame_host.h" |
42 #include "content/public/browser/render_view_host.h" | 42 #include "content/public/browser/render_view_host.h" |
43 #include "content/public/browser/user_metrics.h" | 43 #include "content/public/browser/user_metrics.h" |
44 #include "content/public/browser/web_contents.h" | 44 #include "content/public/browser/web_contents.h" |
45 #include "content/public/browser/web_contents_observer.h" | 45 #include "content/public/browser/web_contents_observer.h" |
46 #include "content/public/common/page_transition_types.h" | |
47 #include "content/public/common/renderer_preferences.h" | 46 #include "content/public/common/renderer_preferences.h" |
48 #include "content/public/common/url_constants.h" | 47 #include "content/public/common/url_constants.h" |
49 #include "extensions/browser/extension_system.h" | 48 #include "extensions/browser/extension_system.h" |
50 #include "extensions/common/extension_set.h" | 49 #include "extensions/common/extension_set.h" |
51 #include "extensions/common/permissions/permissions_data.h" | 50 #include "extensions/common/permissions/permissions_data.h" |
52 #include "ui/base/l10n/l10n_util.h" | 51 #include "ui/base/l10n/l10n_util.h" |
| 52 #include "ui/base/page_transition_types.h" |
53 | 53 |
54 using base::DictionaryValue; | 54 using base::DictionaryValue; |
55 using content::BrowserThread; | 55 using content::BrowserThread; |
56 | 56 |
57 namespace { | 57 namespace { |
58 | 58 |
59 static const char kFrontendHostId[] = "id"; | 59 static const char kFrontendHostId[] = "id"; |
60 static const char kFrontendHostMethod[] = "method"; | 60 static const char kFrontendHostMethod[] = "method"; |
61 static const char kFrontendHostParams[] = "params"; | 61 static const char kFrontendHostParams[] = "params"; |
62 static const char kTitleFormat[] = "Developer Tools - %s"; | 62 static const char kTitleFormat[] = "Developer Tools - %s"; |
(...skipping 138 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
201 }; | 201 }; |
202 | 202 |
203 void DefaultBindingsDelegate::ActivateWindow() { | 203 void DefaultBindingsDelegate::ActivateWindow() { |
204 web_contents_->GetDelegate()->ActivateContents(web_contents_); | 204 web_contents_->GetDelegate()->ActivateContents(web_contents_); |
205 web_contents_->Focus(); | 205 web_contents_->Focus(); |
206 } | 206 } |
207 | 207 |
208 void DefaultBindingsDelegate::OpenInNewTab(const std::string& url) { | 208 void DefaultBindingsDelegate::OpenInNewTab(const std::string& url) { |
209 content::OpenURLParams params( | 209 content::OpenURLParams params( |
210 GURL(url), content::Referrer(), NEW_FOREGROUND_TAB, | 210 GURL(url), content::Referrer(), NEW_FOREGROUND_TAB, |
211 content::PAGE_TRANSITION_LINK, false); | 211 ui::PAGE_TRANSITION_LINK, false); |
212 Browser* browser = FindBrowser(web_contents_); | 212 Browser* browser = FindBrowser(web_contents_); |
213 browser->OpenURL(params); | 213 browser->OpenURL(params); |
214 } | 214 } |
215 | 215 |
216 void DefaultBindingsDelegate::InspectedContentsClosing() { | 216 void DefaultBindingsDelegate::InspectedContentsClosing() { |
217 web_contents_->GetRenderViewHost()->ClosePage(); | 217 web_contents_->GetRenderViewHost()->ClosePage(); |
218 } | 218 } |
219 | 219 |
220 InfoBarService* DefaultBindingsDelegate::GetInfoBarService() { | 220 InfoBarService* DefaultBindingsDelegate::GetInfoBarService() { |
221 return InfoBarService::FromWebContents(web_contents_); | 221 return InfoBarService::FromWebContents(web_contents_); |
(...skipping 619 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 web_contents_->GetMainFrame()->ExecuteJavaScript(javascript); | 841 web_contents_->GetMainFrame()->ExecuteJavaScript(javascript); |
842 } | 842 } |
843 | 843 |
844 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { | 844 void DevToolsUIBindings::DocumentOnLoadCompletedInMainFrame() { |
845 // Call delegate first - it seeds importants bit of information. | 845 // Call delegate first - it seeds importants bit of information. |
846 delegate_->OnLoadCompleted(); | 846 delegate_->OnLoadCompleted(); |
847 | 847 |
848 UpdateTheme(); | 848 UpdateTheme(); |
849 AddDevToolsExtensionsToClient(); | 849 AddDevToolsExtensionsToClient(); |
850 } | 850 } |
OLD | NEW |