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/devtools/devtools_window.h" | 5 #include "chrome/browser/devtools/devtools_window.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
10 #include "base/json/json_reader.h" | 10 #include "base/json/json_reader.h" |
(...skipping 29 matching lines...) Expand all Loading... |
40 #include "content/public/browser/devtools_agent_host.h" | 40 #include "content/public/browser/devtools_agent_host.h" |
41 #include "content/public/browser/native_web_keyboard_event.h" | 41 #include "content/public/browser/native_web_keyboard_event.h" |
42 #include "content/public/browser/navigation_controller.h" | 42 #include "content/public/browser/navigation_controller.h" |
43 #include "content/public/browser/navigation_entry.h" | 43 #include "content/public/browser/navigation_entry.h" |
44 #include "content/public/browser/render_frame_host.h" | 44 #include "content/public/browser/render_frame_host.h" |
45 #include "content/public/browser/render_process_host.h" | 45 #include "content/public/browser/render_process_host.h" |
46 #include "content/public/browser/render_view_host.h" | 46 #include "content/public/browser/render_view_host.h" |
47 #include "content/public/browser/render_widget_host_view.h" | 47 #include "content/public/browser/render_widget_host_view.h" |
48 #include "content/public/browser/user_metrics.h" | 48 #include "content/public/browser/user_metrics.h" |
49 #include "content/public/browser/web_contents.h" | 49 #include "content/public/browser/web_contents.h" |
| 50 #include "content/public/browser/web_contents_source.h" |
50 #include "content/public/common/content_client.h" | 51 #include "content/public/common/content_client.h" |
51 #include "content/public/common/url_constants.h" | 52 #include "content/public/common/url_constants.h" |
52 #include "net/base/escape.h" | 53 #include "net/base/escape.h" |
53 #include "third_party/WebKit/public/web/WebInputEvent.h" | 54 #include "third_party/WebKit/public/web/WebInputEvent.h" |
54 #include "ui/base/page_transition_types.h" | 55 #include "ui/base/page_transition_types.h" |
55 #include "ui/events/keycodes/keyboard_code_conversion.h" | 56 #include "ui/events/keycodes/keyboard_code_conversion.h" |
56 #include "ui/events/keycodes/keyboard_codes.h" | 57 #include "ui/events/keycodes/keyboard_codes.h" |
57 | 58 |
58 using base::DictionaryValue; | 59 using base::DictionaryValue; |
59 using blink::WebInputEvent; | 60 using blink::WebInputEvent; |
(...skipping 706 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
766 } | 767 } |
767 } | 768 } |
768 | 769 |
769 // Create WebContents with devtools. | 770 // Create WebContents with devtools. |
770 GURL url(GetDevToolsURL(profile, frontend_url, | 771 GURL url(GetDevToolsURL(profile, frontend_url, |
771 shared_worker_frontend, | 772 shared_worker_frontend, |
772 remote_frontend, | 773 remote_frontend, |
773 can_dock, settings)); | 774 can_dock, settings)); |
774 scoped_ptr<WebContents> main_web_contents( | 775 scoped_ptr<WebContents> main_web_contents( |
775 WebContents::Create(WebContents::CreateParams(profile))); | 776 WebContents::Create(WebContents::CreateParams(profile))); |
| 777 WebContentsSource::CreateForWebContentsAndLocation(main_web_contents.get(), |
| 778 FROM_HERE); |
776 main_web_contents->GetController().LoadURL( | 779 main_web_contents->GetController().LoadURL( |
777 DecorateFrontendURL(url), content::Referrer(), | 780 DecorateFrontendURL(url), content::Referrer(), |
778 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); | 781 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); |
779 DevToolsUIBindings* bindings = | 782 DevToolsUIBindings* bindings = |
780 DevToolsUIBindings::ForWebContents(main_web_contents.get()); | 783 DevToolsUIBindings::ForWebContents(main_web_contents.get()); |
781 if (!bindings) | 784 if (!bindings) |
782 return nullptr; | 785 return nullptr; |
783 | 786 |
784 return new DevToolsWindow(profile, main_web_contents.release(), bindings, | 787 return new DevToolsWindow(profile, main_web_contents.release(), bindings, |
785 inspected_web_contents, can_dock); | 788 inspected_web_contents, can_dock); |
(...skipping 487 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1273 bool DevToolsWindow::ReloadInspectedWebContents(bool ignore_cache) { | 1276 bool DevToolsWindow::ReloadInspectedWebContents(bool ignore_cache) { |
1274 // Only route reload via front-end if the agent is attached. | 1277 // Only route reload via front-end if the agent is attached. |
1275 WebContents* wc = GetInspectedWebContents(); | 1278 WebContents* wc = GetInspectedWebContents(); |
1276 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1279 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
1277 return false; | 1280 return false; |
1278 base::FundamentalValue ignore_cache_value(ignore_cache); | 1281 base::FundamentalValue ignore_cache_value(ignore_cache); |
1279 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1282 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
1280 &ignore_cache_value, nullptr, nullptr); | 1283 &ignore_cache_value, nullptr, nullptr); |
1281 return true; | 1284 return true; |
1282 } | 1285 } |
OLD | NEW |