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

Side by Side Diff: Source/devtools/front_end/screencast/ScreencastView.js

Issue 881263002: DevTools: use target-based model accessors only. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 10 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 | Annotate | Revision Log
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2013 Google Inc. All rights reserved. 2 * Copyright (C) 2013 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 this._titleElement.style.left = "0"; 89 this._titleElement.style.left = "0";
90 90
91 this._imageElement = new Image(); 91 this._imageElement = new Image();
92 this._isCasting = false; 92 this._isCasting = false;
93 this._context = this._canvasElement.getContext("2d"); 93 this._context = this._canvasElement.getContext("2d");
94 this._checkerboardPattern = this._createCheckerboardPattern(this._contex t); 94 this._checkerboardPattern = this._createCheckerboardPattern(this._contex t);
95 95
96 this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}) ; 96 this._shortcuts = /** !Object.<number, function(Event=):boolean> */ ({}) ;
97 this._shortcuts[WebInspector.KeyboardShortcut.makeKey("l", WebInspector. KeyboardShortcut.Modifiers.Ctrl)] = this._focusNavigationBar.bind(this); 97 this._shortcuts[WebInspector.KeyboardShortcut.makeKey("l", WebInspector. KeyboardShortcut.Modifiers.Ctrl)] = this._focusNavigationBar.bind(this);
98 98
99 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre eModel.EventTypes.ScreencastFrame, this._screencastFrame, this); 99 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre eModel.EventTypes.ScreencastFrame, this._screencastFrame, this);
100 WebInspector.resourceTreeModel.addEventListener(WebInspector.ResourceTre eModel.EventTypes.ScreencastVisibilityChanged, this._screencastVisibilityChanged , this); 100 this._target.resourceTreeModel.addEventListener(WebInspector.ResourceTre eModel.EventTypes.ScreencastVisibilityChanged, this._screencastVisibilityChanged , this);
101 101
102 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E vents.SuspendStateChanged, this._onSuspendStateChange, this); 102 WebInspector.targetManager.addEventListener(WebInspector.TargetManager.E vents.SuspendStateChanged, this._onSuspendStateChange, this);
103 this._updateGlasspane(); 103 this._updateGlasspane();
104 }, 104 },
105 105
106 wasShown: function() 106 wasShown: function()
107 { 107 {
108 this._startCasting(); 108 this._startCasting();
109 }, 109 },
110 110
(...skipping 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
737 { 737 {
738 var newIndex = this._historyIndex + offset; 738 var newIndex = this._historyIndex + offset;
739 if (newIndex < 0 || newIndex >= this._historyEntries.length) 739 if (newIndex < 0 || newIndex >= this._historyEntries.length)
740 return; 740 return;
741 this._target.pageAgent().navigateToHistoryEntry(this._historyEntries[new Index].id); 741 this._target.pageAgent().navigateToHistoryEntry(this._historyEntries[new Index].id);
742 this._requestNavigationHistory(); 742 this._requestNavigationHistory();
743 }, 743 },
744 744
745 _navigateReload: function() 745 _navigateReload: function()
746 { 746 {
747 WebInspector.resourceTreeModel.reloadPage(); 747 this._target.resourceTreeModel.reloadPage();
748 }, 748 },
749 749
750 _navigationUrlKeyUp: function(event) 750 _navigationUrlKeyUp: function(event)
751 { 751 {
752 if (event.keyIdentifier != 'Enter') 752 if (event.keyIdentifier != 'Enter')
753 return; 753 return;
754 var url = this._navigationUrl.value; 754 var url = this._navigationUrl.value;
755 if (!url) 755 if (!url)
756 return; 756 return;
757 if (!url.match(WebInspector.ScreencastView._SchemeRegex)) 757 if (!url.match(WebInspector.ScreencastView._SchemeRegex))
(...skipping 108 matching lines...) Expand 10 before | Expand all | Expand 10 after
866 return; 866 return;
867 this._maxDisplayedProgress = progress; 867 this._maxDisplayedProgress = progress;
868 this._displayProgress(progress); 868 this._displayProgress(progress);
869 }, 869 },
870 870
871 _displayProgress: function(progress) 871 _displayProgress: function(progress)
872 { 872 {
873 this._element.style.width = (100 * progress) + "%"; 873 this._element.style.width = (100 * progress) + "%";
874 } 874 }
875 }; 875 };
OLDNEW
« no previous file with comments | « Source/devtools/front_end/resources/ResourcesPanel.js ('k') | Source/devtools/front_end/sdk/CPUProfilerModel.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698