OLD | NEW |
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 18 matching lines...) Expand all Loading... |
29 */ | 29 */ |
30 | 30 |
31 /** | 31 /** |
32 * @constructor | 32 * @constructor |
33 * @extends {WebInspector.VBox} | 33 * @extends {WebInspector.VBox} |
34 * @implements {WebInspector.DOMNodeHighlighter} | 34 * @implements {WebInspector.DOMNodeHighlighter} |
35 */ | 35 */ |
36 WebInspector.ScreencastView = function() | 36 WebInspector.ScreencastView = function() |
37 { | 37 { |
38 WebInspector.VBox.call(this); | 38 WebInspector.VBox.call(this); |
| 39 this.setMinimumSize(new Size(150, 150)); |
39 this.registerRequiredCSS("screencastView.css"); | 40 this.registerRequiredCSS("screencastView.css"); |
40 }; | 41 }; |
41 | 42 |
42 WebInspector.ScreencastView._bordersSize = 40; | 43 WebInspector.ScreencastView._bordersSize = 40; |
43 | 44 |
44 WebInspector.ScreencastView._navBarHeight = 29; | 45 WebInspector.ScreencastView._navBarHeight = 29; |
45 | 46 |
46 WebInspector.ScreencastView._HttpRegex = /^https?:\/\/(.+)/; | 47 WebInspector.ScreencastView._HttpRegex = /^https?:\/\/(.+)/; |
47 | 48 |
48 WebInspector.ScreencastView.Constraints = { | |
49 Width: 150, | |
50 Height: 150 | |
51 }; | |
52 | |
53 WebInspector.ScreencastView.prototype = { | 49 WebInspector.ScreencastView.prototype = { |
54 initialize: function() | 50 initialize: function() |
55 { | 51 { |
56 this.element.classList.add("screencast"); | 52 this.element.classList.add("screencast"); |
57 | 53 |
58 this._createNavigationBar(); | 54 this._createNavigationBar(); |
59 | 55 |
60 this._viewportElement = this.element.createChild("div", "screencast-view
port hidden"); | 56 this._viewportElement = this.element.createChild("div", "screencast-view
port hidden"); |
61 this._glassPaneElement = this.element.createChild("div", "screencast-gla
sspane hidden"); | 57 this._glassPaneElement = this.element.createChild("div", "screencast-gla
sspane hidden"); |
62 | 58 |
(...skipping 858 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
921 | 917 |
922 /** | 918 /** |
923 * @constructor | 919 * @constructor |
924 */ | 920 */ |
925 WebInspector.ScreencastController = function() | 921 WebInspector.ScreencastController = function() |
926 { | 922 { |
927 var rootView = new WebInspector.RootView(); | 923 var rootView = new WebInspector.RootView(); |
928 | 924 |
929 this._rootSplitView = new WebInspector.SplitView(false, true, "InspectorView
.screencastSplitViewState", 300, 300); | 925 this._rootSplitView = new WebInspector.SplitView(false, true, "InspectorView
.screencastSplitViewState", 300, 300); |
930 this._rootSplitView.show(rootView.element); | 926 this._rootSplitView.show(rootView.element); |
931 this._rootSplitView.setSidebarElementConstraints(180, 50); | |
932 this._rootSplitView.setMainElementConstraints(WebInspector.ScreencastView.Co
nstraints.Width, WebInspector.ScreencastView.Constraints.Height); | |
933 | 927 |
934 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); | 928 WebInspector.inspectorView.show(this._rootSplitView.sidebarElement()); |
935 this._screencastView = new WebInspector.ScreencastView(); | 929 this._screencastView = new WebInspector.ScreencastView(); |
936 this._screencastView.show(this._rootSplitView.mainElement()); | 930 this._screencastView.show(this._rootSplitView.mainElement()); |
937 | 931 |
938 this._onStatusBarButtonStateChanged("disabled"); | 932 this._onStatusBarButtonStateChanged("disabled"); |
939 rootView.show(document.body); | 933 rootView.attachToBody(); |
940 | 934 |
941 this._initialized = false; | 935 this._initialized = false; |
942 }; | 936 }; |
943 | 937 |
944 WebInspector.ScreencastController.prototype = { | 938 WebInspector.ScreencastController.prototype = { |
945 /** | 939 /** |
946 * @param {string} state | 940 * @param {string} state |
947 */ | 941 */ |
948 _onStatusBarButtonStateChanged: function(state) | 942 _onStatusBarButtonStateChanged: function(state) |
949 { | 943 { |
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
988 * @return {!Element} | 982 * @return {!Element} |
989 */ | 983 */ |
990 statusBarItem: function() | 984 statusBarItem: function() |
991 { | 985 { |
992 if (this._initialized) | 986 if (this._initialized) |
993 return this._toggleScreencastButton.element; | 987 return this._toggleScreencastButton.element; |
994 this._statusBarPlaceholder = document.createElement("div"); | 988 this._statusBarPlaceholder = document.createElement("div"); |
995 return this._statusBarPlaceholder; | 989 return this._statusBarPlaceholder; |
996 } | 990 } |
997 }; | 991 }; |
OLD | NEW |