Chromium Code Reviews| 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 446 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 457 return; | 457 return; |
| 458 window->bindings_->AttachTo(worker_agent); | 458 window->bindings_->AttachTo(worker_agent); |
| 459 } | 459 } |
| 460 window->ScheduleShow(DevToolsToggleAction::Show()); | 460 window->ScheduleShow(DevToolsToggleAction::Show()); |
| 461 } | 461 } |
| 462 | 462 |
| 463 // static | 463 // static |
| 464 DevToolsWindow* DevToolsWindow::CreateDevToolsWindowForWorker( | 464 DevToolsWindow* DevToolsWindow::CreateDevToolsWindowForWorker( |
| 465 Profile* profile) { | 465 Profile* profile) { |
| 466 content::RecordAction(base::UserMetricsAction("DevTools_InspectWorker")); | 466 content::RecordAction(base::UserMetricsAction("DevTools_InspectWorker")); |
| 467 return Create(profile, GURL(), NULL, true, false, std::string(), false, ""); | 467 return Create(profile, GURL(), NULL, true, false, std::string(), false, "", |
| 468 ""); | |
| 468 } | 469 } |
| 469 | 470 |
| 470 // static | 471 // static |
| 471 void DevToolsWindow::OpenDevToolsWindow( | 472 void DevToolsWindow::OpenDevToolsWindow( |
| 472 content::WebContents* inspected_web_contents) { | 473 content::WebContents* inspected_web_contents) { |
| 473 ToggleDevToolsWindow( | 474 ToggleDevToolsWindow( |
| 474 inspected_web_contents, true, DevToolsToggleAction::Show(), ""); | 475 inspected_web_contents, true, DevToolsToggleAction::Show(), ""); |
| 475 } | 476 } |
| 476 | 477 |
| 477 // static | 478 // static |
| (...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 517 ToggleDevToolsWindow(inspected_web_contents, true, action, ""); | 518 ToggleDevToolsWindow(inspected_web_contents, true, action, ""); |
| 518 } | 519 } |
| 519 | 520 |
| 520 // static | 521 // static |
| 521 void DevToolsWindow::OpenDevToolsWindowForFrame( | 522 void DevToolsWindow::OpenDevToolsWindowForFrame( |
| 522 Profile* profile, | 523 Profile* profile, |
| 523 const scoped_refptr<content::DevToolsAgentHost>& agent_host) { | 524 const scoped_refptr<content::DevToolsAgentHost>& agent_host) { |
| 524 DevToolsWindow* window = FindDevToolsWindow(agent_host.get()); | 525 DevToolsWindow* window = FindDevToolsWindow(agent_host.get()); |
| 525 if (!window) { | 526 if (!window) { |
| 526 window = DevToolsWindow::Create(profile, GURL(), nullptr, false, false, | 527 window = DevToolsWindow::Create(profile, GURL(), nullptr, false, false, |
| 527 std::string(), false, std::string()); | 528 std::string(), false, std::string(), |
| 529 std::string()); | |
|
einbinder
2016/12/09 00:28:56
Do we prefer std::string() over ""? Both seem to g
dgozman
2016/12/09 22:19:31
Should not matter.
| |
| 528 if (!window) | 530 if (!window) |
| 529 return; | 531 return; |
| 530 window->bindings_->AttachTo(agent_host); | 532 window->bindings_->AttachTo(agent_host); |
| 531 } | 533 } |
| 532 window->ScheduleShow(DevToolsToggleAction::Show()); | 534 window->ScheduleShow(DevToolsToggleAction::Show()); |
| 533 } | 535 } |
| 534 | 536 |
| 535 // static | 537 // static |
| 536 void DevToolsWindow::ToggleDevToolsWindow( | 538 void DevToolsWindow::ToggleDevToolsWindow( |
| 537 Browser* browser, | 539 Browser* browser, |
| (...skipping 13 matching lines...) Expand all Loading... | |
| 551 // static | 553 // static |
| 552 void DevToolsWindow::OpenExternalFrontend( | 554 void DevToolsWindow::OpenExternalFrontend( |
| 553 Profile* profile, | 555 Profile* profile, |
| 554 const std::string& frontend_url, | 556 const std::string& frontend_url, |
| 555 const scoped_refptr<content::DevToolsAgentHost>& agent_host, | 557 const scoped_refptr<content::DevToolsAgentHost>& agent_host, |
| 556 bool is_worker, | 558 bool is_worker, |
| 557 bool is_v8_only) { | 559 bool is_v8_only) { |
| 558 DevToolsWindow* window = FindDevToolsWindow(agent_host.get()); | 560 DevToolsWindow* window = FindDevToolsWindow(agent_host.get()); |
| 559 if (!window) { | 561 if (!window) { |
| 560 window = Create(profile, GURL(), nullptr, is_worker, is_v8_only, | 562 window = Create(profile, GURL(), nullptr, is_worker, is_v8_only, |
| 561 DevToolsUI::GetProxyURL(frontend_url).spec(), false, std::string()); | 563 DevToolsUI::GetProxyURL(frontend_url).spec(), false, |
| 564 std::string(), std::string()); | |
| 562 if (!window) | 565 if (!window) |
| 563 return; | 566 return; |
| 564 window->bindings_->AttachTo(agent_host); | 567 window->bindings_->AttachTo(agent_host); |
| 565 window->close_on_detach_ = false; | 568 window->close_on_detach_ = false; |
| 566 } | 569 } |
| 567 | 570 |
| 568 window->ScheduleShow(DevToolsToggleAction::Show()); | 571 window->ScheduleShow(DevToolsToggleAction::Show()); |
| 569 } | 572 } |
| 570 | 573 |
| 571 // static | 574 // static |
| 572 void DevToolsWindow::ToggleDevToolsWindow( | 575 void DevToolsWindow::ToggleDevToolsWindow( |
| 573 content::WebContents* inspected_web_contents, | 576 content::WebContents* inspected_web_contents, |
| 574 bool force_open, | 577 bool force_open, |
| 575 const DevToolsToggleAction& action, | 578 const DevToolsToggleAction& action, |
| 576 const std::string& settings) { | 579 const std::string& settings) { |
| 577 scoped_refptr<DevToolsAgentHost> agent( | 580 scoped_refptr<DevToolsAgentHost> agent( |
| 578 DevToolsAgentHost::GetOrCreateFor(inspected_web_contents)); | 581 DevToolsAgentHost::GetOrCreateFor(inspected_web_contents)); |
| 579 DevToolsWindow* window = FindDevToolsWindow(agent.get()); | 582 DevToolsWindow* window = FindDevToolsWindow(agent.get()); |
| 580 bool do_open = force_open; | 583 bool do_open = force_open; |
| 581 if (!window) { | 584 if (!window) { |
| 582 Profile* profile = Profile::FromBrowserContext( | 585 Profile* profile = Profile::FromBrowserContext( |
| 583 inspected_web_contents->GetBrowserContext()); | 586 inspected_web_contents->GetBrowserContext()); |
| 584 content::RecordAction( | 587 content::RecordAction( |
| 585 base::UserMetricsAction("DevTools_InspectRenderer")); | 588 base::UserMetricsAction("DevTools_InspectRenderer")); |
| 586 window = Create(profile, GURL(), inspected_web_contents, | 589 std::string panel = ""; |
| 587 false, false, std::string(), true, settings); | 590 switch (action.type()) { |
| 591 case DevToolsToggleAction::kInspect: | |
| 592 panel = "elements"; | |
| 593 break; | |
| 594 case DevToolsToggleAction::kShowSecurityPanel: | |
| 595 panel = "security"; | |
| 596 break; | |
| 597 case DevToolsToggleAction::kShowConsole: | |
| 598 panel = "console"; | |
| 599 break; | |
| 600 case DevToolsToggleAction::kShow: | |
| 601 case DevToolsToggleAction::kToggle: | |
| 602 case DevToolsToggleAction::kReveal: | |
| 603 case DevToolsToggleAction::kNoOp: | |
| 604 break; | |
| 605 default: | |
|
dgozman
2016/12/09 22:19:31
Omit the default clause.
einbinder
2016/12/12 22:04:27
Done.
| |
| 606 NOTREACHED(); | |
| 607 break; | |
| 608 } | |
| 609 window = Create(profile, GURL(), inspected_web_contents, false, false, | |
| 610 std::string(), true, settings, panel); | |
| 588 if (!window) | 611 if (!window) |
| 589 return; | 612 return; |
| 590 window->bindings_->AttachTo(agent.get()); | 613 window->bindings_->AttachTo(agent.get()); |
| 591 do_open = true; | 614 do_open = true; |
| 592 } | 615 } |
| 593 | 616 |
| 594 // Update toolbar to reflect DevTools changes. | 617 // Update toolbar to reflect DevTools changes. |
| 595 window->UpdateBrowserToolbar(); | 618 window->UpdateBrowserToolbar(); |
| 596 | 619 |
| 597 // If window is docked and visible, we hide it on toggle. If window is | 620 // If window is docked and visible, we hide it on toggle. If window is |
| 598 // undocked, we show (activate) it. | 621 // undocked, we show (activate) it. |
| 599 if (!window->is_docked_ || do_open) | 622 if (!window->is_docked_ || do_open) |
| 600 window->ScheduleShow(action); | 623 window->ScheduleShow(action); |
| 601 else | 624 else |
| 602 window->CloseWindow(); | 625 window->CloseWindow(); |
| 603 } | 626 } |
| 604 | 627 |
| 605 // static | 628 // static |
| 606 void DevToolsWindow::InspectElement( | 629 void DevToolsWindow::InspectElement( |
| 607 content::RenderFrameHost* inspected_frame_host, | 630 content::RenderFrameHost* inspected_frame_host, |
| 608 int x, | 631 int x, |
| 609 int y) { | 632 int y) { |
| 610 scoped_refptr<DevToolsAgentHost> agent( | 633 scoped_refptr<DevToolsAgentHost> agent( |
| 611 DevToolsAgentHost::GetOrCreateFor(inspected_frame_host)); | 634 DevToolsAgentHost::GetOrCreateFor(inspected_frame_host)); |
| 612 bool should_measure_time = FindDevToolsWindow(agent.get()) == NULL; | 635 bool should_measure_time = FindDevToolsWindow(agent.get()) == NULL; |
| 613 base::TimeTicks start_time = base::TimeTicks::Now(); | 636 base::TimeTicks start_time = base::TimeTicks::Now(); |
| 614 // TODO(loislo): we should initiate DevTools window opening from within | 637 // TODO(loislo): we should initiate DevTools window opening from within |
| 615 // renderer. Otherwise, we still can hit a race condition here. | 638 // renderer. Otherwise, we still can hit a race condition here. |
| 616 if (agent->GetType() == content::DevToolsAgentHost::kTypePage) { | 639 if (agent->GetType() == content::DevToolsAgentHost::kTypePage) { |
| 617 OpenDevToolsWindow(agent->GetWebContents()); | 640 OpenDevToolsWindow(agent->GetWebContents(), |
| 641 DevToolsToggleAction::Inspect()); | |
|
einbinder
2016/12/09 00:28:56
The Inspect action is for Ctrl+Shift+C. I'm borrow
dgozman
2016/12/09 22:19:31
Let's do action ShowElementsPanel, and rename cons
einbinder
2016/12/12 22:04:27
Done.
| |
| 618 } else { | 642 } else { |
| 619 OpenDevToolsWindowForFrame(Profile::FromBrowserContext( | 643 OpenDevToolsWindowForFrame(Profile::FromBrowserContext( |
| 620 agent->GetBrowserContext()), agent); | 644 agent->GetBrowserContext()), agent); |
| 621 } | 645 } |
| 622 DevToolsWindow* window = FindDevToolsWindow(agent.get()); | 646 DevToolsWindow* window = FindDevToolsWindow(agent.get()); |
| 623 if (window) { | 647 if (window) { |
| 624 agent->InspectElement(window->bindings_, x, y); | 648 agent->InspectElement(window->bindings_, x, y); |
| 625 if (should_measure_time) | 649 if (should_measure_time) |
| 626 window->inspect_element_start_time_ = start_time; | 650 window->inspect_element_start_time_ = start_time; |
| 627 } | 651 } |
| (...skipping 14 matching lines...) Expand all Loading... | |
| 642 Show(DevToolsToggleAction::Show()); | 666 Show(DevToolsToggleAction::Show()); |
| 643 } | 667 } |
| 644 } | 668 } |
| 645 | 669 |
| 646 void DevToolsWindow::Show(const DevToolsToggleAction& action) { | 670 void DevToolsWindow::Show(const DevToolsToggleAction& action) { |
| 647 if (life_stage_ == kClosing) | 671 if (life_stage_ == kClosing) |
| 648 return; | 672 return; |
| 649 | 673 |
| 650 if (action.type() == DevToolsToggleAction::kNoOp) | 674 if (action.type() == DevToolsToggleAction::kNoOp) |
| 651 return; | 675 return; |
| 652 | |
| 653 if (is_docked_) { | 676 if (is_docked_) { |
| 654 DCHECK(can_dock_); | 677 DCHECK(can_dock_); |
| 655 Browser* inspected_browser = NULL; | 678 Browser* inspected_browser = NULL; |
| 656 int inspected_tab_index = -1; | 679 int inspected_tab_index = -1; |
| 657 FindInspectedBrowserAndTabIndex(GetInspectedWebContents(), | 680 FindInspectedBrowserAndTabIndex(GetInspectedWebContents(), |
| 658 &inspected_browser, | 681 &inspected_browser, |
| 659 &inspected_tab_index); | 682 &inspected_tab_index); |
| 660 DCHECK(inspected_browser); | 683 DCHECK(inspected_browser); |
| 661 DCHECK(inspected_tab_index != -1); | 684 DCHECK(inspected_tab_index != -1); |
| 662 | 685 |
| (...skipping 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 833 | 856 |
| 834 // static | 857 // static |
| 835 DevToolsWindow* DevToolsWindow::Create( | 858 DevToolsWindow* DevToolsWindow::Create( |
| 836 Profile* profile, | 859 Profile* profile, |
| 837 const GURL& frontend_url, | 860 const GURL& frontend_url, |
| 838 content::WebContents* inspected_web_contents, | 861 content::WebContents* inspected_web_contents, |
| 839 bool shared_worker_frontend, | 862 bool shared_worker_frontend, |
| 840 bool v8_only_frontend, | 863 bool v8_only_frontend, |
| 841 const std::string& remote_frontend, | 864 const std::string& remote_frontend, |
| 842 bool can_dock, | 865 bool can_dock, |
| 843 const std::string& settings) { | 866 const std::string& settings, |
| 867 const std::string& panel) { | |
| 844 if (profile->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled) || | 868 if (profile->GetPrefs()->GetBoolean(prefs::kDevToolsDisabled) || |
| 845 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) | 869 base::CommandLine::ForCurrentProcess()->HasSwitch(switches::kKioskMode)) |
| 846 return nullptr; | 870 return nullptr; |
| 847 | 871 |
| 848 if (inspected_web_contents) { | 872 if (inspected_web_contents) { |
| 849 // Check for a place to dock. | 873 // Check for a place to dock. |
| 850 Browser* browser = NULL; | 874 Browser* browser = NULL; |
| 851 int tab; | 875 int tab; |
| 852 if (!FindInspectedBrowserAndTabIndex(inspected_web_contents, | 876 if (!FindInspectedBrowserAndTabIndex(inspected_web_contents, |
| 853 &browser, &tab) || | 877 &browser, &tab) || |
| 854 browser->is_type_popup()) { | 878 browser->is_type_popup()) { |
| 855 can_dock = false; | 879 can_dock = false; |
| 856 } | 880 } |
| 857 } | 881 } |
| 858 | 882 |
| 859 // Create WebContents with devtools. | 883 // Create WebContents with devtools. |
| 860 GURL url(GetDevToolsURL(profile, frontend_url, | 884 GURL url(GetDevToolsURL(profile, frontend_url, shared_worker_frontend, |
| 861 shared_worker_frontend, | 885 v8_only_frontend, remote_frontend, can_dock, panel)); |
| 862 v8_only_frontend, | |
| 863 remote_frontend, | |
| 864 can_dock)); | |
| 865 std::unique_ptr<WebContents> main_web_contents( | 886 std::unique_ptr<WebContents> main_web_contents( |
| 866 WebContents::Create(WebContents::CreateParams(profile))); | 887 WebContents::Create(WebContents::CreateParams(profile))); |
| 867 main_web_contents->GetController().LoadURL( | 888 main_web_contents->GetController().LoadURL( |
| 868 DecorateFrontendURL(url), content::Referrer(), | 889 DecorateFrontendURL(url), content::Referrer(), |
| 869 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); | 890 ui::PAGE_TRANSITION_AUTO_TOPLEVEL, std::string()); |
| 870 DevToolsUIBindings* bindings = | 891 DevToolsUIBindings* bindings = |
| 871 DevToolsUIBindings::ForWebContents(main_web_contents.get()); | 892 DevToolsUIBindings::ForWebContents(main_web_contents.get()); |
| 872 if (!bindings) | 893 if (!bindings) |
| 873 return nullptr; | 894 return nullptr; |
| 874 if (!settings.empty()) | 895 if (!settings.empty()) |
| 875 SetPreferencesFromJson(profile, settings); | 896 SetPreferencesFromJson(profile, settings); |
| 876 return new DevToolsWindow(profile, main_web_contents.release(), bindings, | 897 return new DevToolsWindow(profile, main_web_contents.release(), bindings, |
| 877 inspected_web_contents, can_dock); | 898 inspected_web_contents, can_dock); |
| 878 } | 899 } |
| 879 | 900 |
| 880 // static | 901 // static |
| 881 GURL DevToolsWindow::GetDevToolsURL(Profile* profile, | 902 GURL DevToolsWindow::GetDevToolsURL(Profile* profile, |
| 882 const GURL& base_url, | 903 const GURL& base_url, |
| 883 bool shared_worker_frontend, | 904 bool shared_worker_frontend, |
| 884 bool v8_only_frontend, | 905 bool v8_only_frontend, |
| 885 const std::string& remote_frontend, | 906 const std::string& remote_frontend, |
| 886 bool can_dock) { | 907 bool can_dock, |
| 908 const std::string& panel) { | |
| 887 // Compatibility errors are encoded with data urls, pass them | 909 // Compatibility errors are encoded with data urls, pass them |
| 888 // through with no decoration. | 910 // through with no decoration. |
| 889 if (base_url.SchemeIs("data")) | 911 if (base_url.SchemeIs("data")) |
| 890 return base_url; | 912 return base_url; |
| 891 | 913 |
| 892 std::string frontend_url( | 914 std::string frontend_url( |
| 893 !remote_frontend.empty() ? | 915 !remote_frontend.empty() ? |
| 894 remote_frontend : | 916 remote_frontend : |
| 895 base_url.is_empty() ? chrome::kChromeUIDevToolsURL : base_url.spec()); | 917 base_url.is_empty() ? chrome::kChromeUIDevToolsURL : base_url.spec()); |
| 896 std::string url_string( | 918 std::string url_string( |
| 897 frontend_url + | 919 frontend_url + |
| 898 ((frontend_url.find("?") == std::string::npos) ? "?" : "&")); | 920 ((frontend_url.find("?") == std::string::npos) ? "?" : "&")); |
| 899 if (shared_worker_frontend) | 921 if (shared_worker_frontend) |
| 900 url_string += "&isSharedWorker=true"; | 922 url_string += "&isSharedWorker=true"; |
| 901 if (v8_only_frontend) | 923 if (v8_only_frontend) |
| 902 url_string += "&v8only=true"; | 924 url_string += "&v8only=true"; |
| 903 if (remote_frontend.size()) { | 925 if (remote_frontend.size()) { |
| 904 url_string += "&remoteFrontend=true"; | 926 url_string += "&remoteFrontend=true"; |
| 905 } else { | 927 } else { |
| 906 url_string += "&remoteBase=" + DevToolsUI::GetRemoteBaseURL().spec(); | 928 url_string += "&remoteBase=" + DevToolsUI::GetRemoteBaseURL().spec(); |
| 907 } | 929 } |
| 908 if (can_dock) | 930 if (can_dock) |
| 909 url_string += "&can_dock=true"; | 931 url_string += "&can_dock=true"; |
| 932 if (panel.size()) | |
| 933 url_string += "&panel=" + panel; | |
|
einbinder
2016/12/09 00:28:56
Concatenating the string here feels dangerous.
| |
| 910 return DevToolsUI::SanitizeFrontendURL(GURL(url_string)); | 934 return DevToolsUI::SanitizeFrontendURL(GURL(url_string)); |
| 911 } | 935 } |
| 912 | 936 |
| 913 // static | 937 // static |
| 914 DevToolsWindow* DevToolsWindow::FindDevToolsWindow( | 938 DevToolsWindow* DevToolsWindow::FindDevToolsWindow( |
| 915 DevToolsAgentHost* agent_host) { | 939 DevToolsAgentHost* agent_host) { |
| 916 if (!agent_host || g_instances == NULL) | 940 if (!agent_host || g_instances == NULL) |
| 917 return NULL; | 941 return NULL; |
| 918 DevToolsWindows* instances = g_instances.Pointer(); | 942 DevToolsWindows* instances = g_instances.Pointer(); |
| 919 for (DevToolsWindows::iterator it(instances->begin()); it != instances->end(); | 943 for (DevToolsWindows::iterator it(instances->begin()); it != instances->end(); |
| (...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1304 NULL); | 1328 NULL); |
| 1305 break; | 1329 break; |
| 1306 } | 1330 } |
| 1307 case DevToolsToggleAction::kShowSecurityPanel: { | 1331 case DevToolsToggleAction::kShowSecurityPanel: { |
| 1308 base::StringValue panel_name("security"); | 1332 base::StringValue panel_name("security"); |
| 1309 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL, | 1333 bindings_->CallClientFunction("DevToolsAPI.showPanel", &panel_name, NULL, |
| 1310 NULL); | 1334 NULL); |
| 1311 break; | 1335 break; |
| 1312 } | 1336 } |
| 1313 case DevToolsToggleAction::kInspect: | 1337 case DevToolsToggleAction::kInspect: |
| 1314 bindings_->CallClientFunction( | 1338 bindings_->CallClientFunction("DevToolsAPI.enterInspectElementMode", NULL, |
| 1315 "DevToolsAPI.enterInspectElementMode", NULL, NULL, NULL); | 1339 NULL, NULL); |
| 1316 break; | 1340 break; |
| 1317 | 1341 |
| 1318 case DevToolsToggleAction::kShow: | 1342 case DevToolsToggleAction::kShow: |
| 1319 case DevToolsToggleAction::kToggle: | 1343 case DevToolsToggleAction::kToggle: |
| 1320 // Do nothing. | 1344 // Do nothing. |
| 1321 break; | 1345 break; |
| 1322 | 1346 |
| 1323 case DevToolsToggleAction::kReveal: { | 1347 case DevToolsToggleAction::kReveal: { |
| 1324 const DevToolsToggleAction::RevealParams* params = | 1348 const DevToolsToggleAction::RevealParams* params = |
| 1325 action.params(); | 1349 action.params(); |
| (...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1382 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { | 1406 bool DevToolsWindow::ReloadInspectedWebContents(bool bypass_cache) { |
| 1383 // Only route reload via front-end if the agent is attached. | 1407 // Only route reload via front-end if the agent is attached. |
| 1384 WebContents* wc = GetInspectedWebContents(); | 1408 WebContents* wc = GetInspectedWebContents(); |
| 1385 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) | 1409 if (!wc || wc->GetCrashedStatus() != base::TERMINATION_STATUS_STILL_RUNNING) |
| 1386 return false; | 1410 return false; |
| 1387 base::FundamentalValue bypass_cache_value(bypass_cache); | 1411 base::FundamentalValue bypass_cache_value(bypass_cache); |
| 1388 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", | 1412 bindings_->CallClientFunction("DevToolsAPI.reloadInspectedPage", |
| 1389 &bypass_cache_value, nullptr, nullptr); | 1413 &bypass_cache_value, nullptr, nullptr); |
| 1390 return true; | 1414 return true; |
| 1391 } | 1415 } |
| OLD | NEW |