| 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 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 #include "chrome/common/pref_names.h" | 37 #include "chrome/common/pref_names.h" |
| 38 #include "chrome/common/url_constants.h" | 38 #include "chrome/common/url_constants.h" |
| 39 #include "chrome/grit/generated_resources.h" | 39 #include "chrome/grit/generated_resources.h" |
| 40 #include "components/infobars/core/confirm_infobar_delegate.h" | 40 #include "components/infobars/core/confirm_infobar_delegate.h" |
| 41 #include "components/infobars/core/infobar.h" | 41 #include "components/infobars/core/infobar.h" |
| 42 #include "components/prefs/scoped_user_pref_update.h" | 42 #include "components/prefs/scoped_user_pref_update.h" |
| 43 #include "components/syncable_prefs/pref_service_syncable.h" | 43 #include "components/syncable_prefs/pref_service_syncable.h" |
| 44 #include "components/zoom/page_zoom.h" | 44 #include "components/zoom/page_zoom.h" |
| 45 #include "content/public/browser/devtools_external_agent_proxy.h" | 45 #include "content/public/browser/devtools_external_agent_proxy.h" |
| 46 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" | 46 #include "content/public/browser/devtools_external_agent_proxy_delegate.h" |
| 47 #include "content/public/browser/invalidate_type.h" | |
| 48 #include "content/public/browser/navigation_controller.h" | 47 #include "content/public/browser/navigation_controller.h" |
| 49 #include "content/public/browser/navigation_entry.h" | 48 #include "content/public/browser/navigation_entry.h" |
| 50 #include "content/public/browser/notification_source.h" | 49 #include "content/public/browser/notification_source.h" |
| 51 #include "content/public/browser/render_frame_host.h" | 50 #include "content/public/browser/render_frame_host.h" |
| 52 #include "content/public/browser/render_view_host.h" | 51 #include "content/public/browser/render_view_host.h" |
| 53 #include "content/public/browser/user_metrics.h" | 52 #include "content/public/browser/user_metrics.h" |
| 54 #include "content/public/browser/web_contents.h" | 53 #include "content/public/browser/web_contents.h" |
| 55 #include "content/public/browser/web_contents_observer.h" | 54 #include "content/public/browser/web_contents_observer.h" |
| 56 #include "content/public/common/renderer_preferences.h" | 55 #include "content/public/common/renderer_preferences.h" |
| 57 #include "content/public/common/url_constants.h" | 56 #include "content/public/common/url_constants.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 529 } | 528 } |
| 530 | 529 |
| 531 void DevToolsUIBindings::InspectElementCompleted() { | 530 void DevToolsUIBindings::InspectElementCompleted() { |
| 532 delegate_->InspectElementCompleted(); | 531 delegate_->InspectElementCompleted(); |
| 533 } | 532 } |
| 534 | 533 |
| 535 void DevToolsUIBindings::InspectedURLChanged(const std::string& url) { | 534 void DevToolsUIBindings::InspectedURLChanged(const std::string& url) { |
| 536 content::NavigationController& controller = web_contents()->GetController(); | 535 content::NavigationController& controller = web_contents()->GetController(); |
| 537 content::NavigationEntry* entry = controller.GetActiveEntry(); | 536 content::NavigationEntry* entry = controller.GetActiveEntry(); |
| 538 // DevTools UI is not localized. | 537 // DevTools UI is not localized. |
| 539 entry->SetTitle( | 538 web_contents()->UpdateTitleForEntry( |
| 540 base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); | 539 entry, base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); |
| 541 web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TITLE); | |
| 542 } | 540 } |
| 543 | 541 |
| 544 void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, | 542 void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, |
| 545 const std::string& url, | 543 const std::string& url, |
| 546 const std::string& headers, | 544 const std::string& headers, |
| 547 int stream_id) { | 545 int stream_id) { |
| 548 GURL gurl(url); | 546 GURL gurl(url); |
| 549 if (!gurl.is_valid()) { | 547 if (!gurl.is_valid()) { |
| 550 base::DictionaryValue response; | 548 base::DictionaryValue response; |
| 551 response.SetInteger("statusCode", 404); | 549 response.SetInteger("statusCode", 404); |
| (...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1101 void DevToolsUIBindings::FrontendLoaded() { | 1099 void DevToolsUIBindings::FrontendLoaded() { |
| 1102 if (frontend_loaded_) | 1100 if (frontend_loaded_) |
| 1103 return; | 1101 return; |
| 1104 frontend_loaded_ = true; | 1102 frontend_loaded_ = true; |
| 1105 | 1103 |
| 1106 // Call delegate first - it seeds importants bit of information. | 1104 // Call delegate first - it seeds importants bit of information. |
| 1107 delegate_->OnLoadCompleted(); | 1105 delegate_->OnLoadCompleted(); |
| 1108 | 1106 |
| 1109 AddDevToolsExtensionsToClient(); | 1107 AddDevToolsExtensionsToClient(); |
| 1110 } | 1108 } |
| OLD | NEW |