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

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

Issue 1031393002: [DevTools] Remove unused messages (Chromium side) (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « chrome/browser/devtools/devtools_ui_bindings.h ('k') | chrome/browser/ui/webui/inspect_ui.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 "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/metrics/histogram.h" 10 #include "base/metrics/histogram.h"
(...skipping 391 matching lines...) Expand 10 before | Expand all | Expand 10 after
402 url_string += "&debugFrontend=true"; 402 url_string += "&debugFrontend=true";
403 #endif // defined(DEBUG_DEVTOOLS) 403 #endif // defined(DEBUG_DEVTOOLS)
404 return GURL(url_string); 404 return GURL(url_string);
405 } 405 }
406 406
407 DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents) 407 DevToolsUIBindings::DevToolsUIBindings(content::WebContents* web_contents)
408 : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())), 408 : profile_(Profile::FromBrowserContext(web_contents->GetBrowserContext())),
409 android_bridge_(DevToolsAndroidBridge::Factory::GetForProfile(profile_)), 409 android_bridge_(DevToolsAndroidBridge::Factory::GetForProfile(profile_)),
410 web_contents_(web_contents), 410 web_contents_(web_contents),
411 delegate_(new DefaultBindingsDelegate(web_contents_)), 411 delegate_(new DefaultBindingsDelegate(web_contents_)),
412 device_count_updates_enabled_(false),
413 devices_updates_enabled_(false), 412 devices_updates_enabled_(false),
414 frontend_loaded_(false), 413 frontend_loaded_(false),
415 weak_factory_(this) { 414 weak_factory_(this) {
416 g_instances.Get().push_back(this); 415 g_instances.Get().push_back(this);
417 frontend_contents_observer_.reset(new FrontendWebContentsObserver(this)); 416 frontend_contents_observer_.reset(new FrontendWebContentsObserver(this));
418 web_contents_->GetMutableRendererPrefs()->can_accept_load_drops = false; 417 web_contents_->GetMutableRendererPrefs()->can_accept_load_drops = false;
419 418
420 file_helper_.reset(new DevToolsFileHelper(web_contents_, profile_)); 419 file_helper_.reset(new DevToolsFileHelper(web_contents_, profile_));
421 file_system_indexer_ = new DevToolsFileSystemIndexer(); 420 file_system_indexer_ = new DevToolsFileSystemIndexer();
422 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents( 421 extensions::ChromeExtensionWebContentsObserver::CreateForWebContents(
(...skipping 23 matching lines...) Expand all
446 delete pair.first; 445 delete pair.first;
447 446
448 if (agent_host_.get()) 447 if (agent_host_.get())
449 agent_host_->DetachClient(); 448 agent_host_->DetachClient();
450 449
451 for (IndexingJobsMap::const_iterator jobs_it(indexing_jobs_.begin()); 450 for (IndexingJobsMap::const_iterator jobs_it(indexing_jobs_.begin());
452 jobs_it != indexing_jobs_.end(); ++jobs_it) { 451 jobs_it != indexing_jobs_.end(); ++jobs_it) {
453 jobs_it->second->Stop(); 452 jobs_it->second->Stop();
454 } 453 }
455 indexing_jobs_.clear(); 454 indexing_jobs_.clear();
456 SetDeviceCountUpdatesEnabled(false);
457 SetDevicesUpdatesEnabled(false); 455 SetDevicesUpdatesEnabled(false);
458 456
459 // Remove self from global list. 457 // Remove self from global list.
460 DevToolsUIBindingsList* instances = g_instances.Pointer(); 458 DevToolsUIBindingsList* instances = g_instances.Pointer();
461 DevToolsUIBindingsList::iterator it( 459 DevToolsUIBindingsList::iterator it(
462 std::find(instances->begin(), instances->end(), this)); 460 std::find(instances->begin(), instances->end(), this));
463 DCHECK(it != instances->end()); 461 DCHECK(it != instances->end());
464 instances->erase(it); 462 instances->erase(it);
465 } 463 }
466 464
(...skipping 251 matching lines...) Expand 10 before | Expand all | Expand 10 after
718 } 716 }
719 717
720 void DevToolsUIBindings::ZoomOut() { 718 void DevToolsUIBindings::ZoomOut() {
721 ui_zoom::PageZoom::Zoom(web_contents(), content::PAGE_ZOOM_OUT); 719 ui_zoom::PageZoom::Zoom(web_contents(), content::PAGE_ZOOM_OUT);
722 } 720 }
723 721
724 void DevToolsUIBindings::ResetZoom() { 722 void DevToolsUIBindings::ResetZoom() {
725 ui_zoom::PageZoom::Zoom(web_contents(), content::PAGE_ZOOM_RESET); 723 ui_zoom::PageZoom::Zoom(web_contents(), content::PAGE_ZOOM_RESET);
726 } 724 }
727 725
728 static void InspectTarget(Profile* profile, DevToolsTargetImpl* target) {
729 if (target)
730 target->Inspect(profile);
731 }
732
733 void DevToolsUIBindings::OpenUrlOnRemoteDeviceAndInspect(
734 const std::string& browser_id,
735 const std::string& url) {
736 if (remote_targets_handler_) {
737 remote_targets_handler_->Open(browser_id, url,
738 base::Bind(&InspectTarget, profile_));
739 }
740 }
741
742 void DevToolsUIBindings::SetDeviceCountUpdatesEnabled(bool enabled) {
743 if (device_count_updates_enabled_ == enabled)
744 return;
745 DevToolsAndroidBridge* adb_bridge =
746 DevToolsAndroidBridge::Factory::GetForProfile(profile_);
747 if (!adb_bridge)
748 return;
749
750 device_count_updates_enabled_ = enabled;
751 if (enabled)
752 adb_bridge->AddDeviceCountListener(this);
753 else
754 adb_bridge->RemoveDeviceCountListener(this);
755 }
756
757 void DevToolsUIBindings::SetDevicesUpdatesEnabled(bool enabled) { 726 void DevToolsUIBindings::SetDevicesUpdatesEnabled(bool enabled) {
758 if (devices_updates_enabled_ == enabled) 727 if (devices_updates_enabled_ == enabled)
759 return; 728 return;
760 devices_updates_enabled_ = enabled; 729 devices_updates_enabled_ = enabled;
761 if (enabled) { 730 if (enabled) {
762 remote_targets_handler_ = DevToolsTargetsUIHandler::CreateForAdb( 731 remote_targets_handler_ = DevToolsTargetsUIHandler::CreateForAdb(
763 base::Bind(&DevToolsUIBindings::DevicesUpdated, 732 base::Bind(&DevToolsUIBindings::DevicesUpdated,
764 base::Unretained(this)), 733 base::Unretained(this)),
765 profile_); 734 profile_);
766 } else { 735 } else {
(...skipping 274 matching lines...) Expand 10 before | Expand all | Expand 10 after
1041 if (frontend_loaded_) 1010 if (frontend_loaded_)
1042 return; 1011 return;
1043 frontend_loaded_ = true; 1012 frontend_loaded_ = true;
1044 1013
1045 // Call delegate first - it seeds importants bit of information. 1014 // Call delegate first - it seeds importants bit of information.
1046 delegate_->OnLoadCompleted(); 1015 delegate_->OnLoadCompleted();
1047 1016
1048 UpdateTheme(); 1017 UpdateTheme();
1049 AddDevToolsExtensionsToClient(); 1018 AddDevToolsExtensionsToClient();
1050 } 1019 }
OLDNEW
« no previous file with comments | « chrome/browser/devtools/devtools_ui_bindings.h ('k') | chrome/browser/ui/webui/inspect_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698