Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(134)

Side by Side Diff: chrome/browser/devtools/devtools_ui_bindings.cc

Issue 2086423005: Using WebContents::UpdateTitleForEntry() instead of NavigationEntry::SetTitle() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Using WebContents::UpdateTitleForEntry() instead of NavigationEntry::SetTitle() Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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" 47 #include "content/public/browser/invalidate_type.h"
Lei Zhang 2016/07/13 23:17:17 Remove?
afakhry 2016/07/13 23:36:17 Done.
48 #include "content/public/browser/navigation_controller.h" 48 #include "content/public/browser/navigation_controller.h"
49 #include "content/public/browser/navigation_entry.h" 49 #include "content/public/browser/navigation_entry.h"
50 #include "content/public/browser/notification_source.h" 50 #include "content/public/browser/notification_source.h"
51 #include "content/public/browser/render_frame_host.h" 51 #include "content/public/browser/render_frame_host.h"
52 #include "content/public/browser/render_view_host.h" 52 #include "content/public/browser/render_view_host.h"
53 #include "content/public/browser/user_metrics.h" 53 #include "content/public/browser/user_metrics.h"
54 #include "content/public/browser/web_contents.h" 54 #include "content/public/browser/web_contents.h"
55 #include "content/public/browser/web_contents_observer.h" 55 #include "content/public/browser/web_contents_observer.h"
56 #include "content/public/common/renderer_preferences.h" 56 #include "content/public/common/renderer_preferences.h"
57 #include "content/public/common/url_constants.h" 57 #include "content/public/common/url_constants.h"
(...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after
529 } 529 }
530 530
531 void DevToolsUIBindings::InspectElementCompleted() { 531 void DevToolsUIBindings::InspectElementCompleted() {
532 delegate_->InspectElementCompleted(); 532 delegate_->InspectElementCompleted();
533 } 533 }
534 534
535 void DevToolsUIBindings::InspectedURLChanged(const std::string& url) { 535 void DevToolsUIBindings::InspectedURLChanged(const std::string& url) {
536 content::NavigationController& controller = web_contents()->GetController(); 536 content::NavigationController& controller = web_contents()->GetController();
537 content::NavigationEntry* entry = controller.GetActiveEntry(); 537 content::NavigationEntry* entry = controller.GetActiveEntry();
538 // DevTools UI is not localized. 538 // DevTools UI is not localized.
539 entry->SetTitle( 539 web_contents()->UpdateTitleForEntry(
540 base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str()))); 540 entry, base::UTF8ToUTF16(base::StringPrintf(kTitleFormat, url.c_str())));
541 web_contents()->NotifyNavigationStateChanged(content::INVALIDATE_TYPE_TITLE);
542 } 541 }
543 542
544 void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback, 543 void DevToolsUIBindings::LoadNetworkResource(const DispatchCallback& callback,
545 const std::string& url, 544 const std::string& url,
546 const std::string& headers, 545 const std::string& headers,
547 int stream_id) { 546 int stream_id) {
548 GURL gurl(url); 547 GURL gurl(url);
549 if (!gurl.is_valid()) { 548 if (!gurl.is_valid()) {
550 base::DictionaryValue response; 549 base::DictionaryValue response;
551 response.SetInteger("statusCode", 404); 550 response.SetInteger("statusCode", 404);
(...skipping 549 matching lines...) Expand 10 before | Expand all | Expand 10 after
1101 void DevToolsUIBindings::FrontendLoaded() { 1100 void DevToolsUIBindings::FrontendLoaded() {
1102 if (frontend_loaded_) 1101 if (frontend_loaded_)
1103 return; 1102 return;
1104 frontend_loaded_ = true; 1103 frontend_loaded_ = true;
1105 1104
1106 // Call delegate first - it seeds importants bit of information. 1105 // Call delegate first - it seeds importants bit of information.
1107 delegate_->OnLoadCompleted(); 1106 delegate_->OnLoadCompleted();
1108 1107
1109 AddDevToolsExtensionsToClient(); 1108 AddDevToolsExtensionsToClient();
1110 } 1109 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698