Bug 991045 - Added Screenshot Button to toolbar's UI;r=pbrosset;
authorvikneshwar <lviknesh@gmail.com>
Fri, 30 May 2014 10:47:49 +0200
changeset 185873 517a797c25339f837d2b1eb5c9100d5b7f878c6d
parent 185872 767e7eb767d836dae111928b2a7a02abf0591ef1
child 185874 652e70044180bc06dd070bdfbe81df4c9de7e52d
push id26867
push userryanvm@gmail.com
push dateFri, 30 May 2014 20:04:22 +0000
treeherdermozilla-central@6f9eb2bb1103 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerspbrosset
bugs991045
milestone32.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 991045 - Added Screenshot Button to toolbar's UI;r=pbrosset;
browser/app/profile/firefox.js
browser/devtools/framework/toolbox.js
browser/locales/en-US/chrome/browser/devtools/gclicommands.properties
browser/themes/linux/jar.mn
browser/themes/osx/jar.mn
browser/themes/shared/devtools/images/command-screenshot.png
browser/themes/shared/devtools/images/command-screenshot@2x.png
browser/themes/shared/devtools/toolbars.inc.css
browser/themes/windows/jar.mn
toolkit/devtools/gcli/commands/screenshot.js
--- a/browser/app/profile/firefox.js
+++ b/browser/app/profile/firefox.js
@@ -1244,28 +1244,29 @@ pref("devtools.webide.enabled", true);
 pref("devtools.webide.enabled", false);
 #endif
 
 // Toolbox preferences
 pref("devtools.toolbox.footer.height", 250);
 pref("devtools.toolbox.sidebar.width", 500);
 pref("devtools.toolbox.host", "bottom");
 pref("devtools.toolbox.selectedTool", "webconsole");
-pref("devtools.toolbox.toolbarSpec", '["splitconsole", "paintflashing toggle","tilt toggle","scratchpad","resize toggle","eyedropper"]');
+pref("devtools.toolbox.toolbarSpec", '["splitconsole", "paintflashing toggle","tilt toggle","scratchpad","resize toggle","eyedropper","screenshot --fullpage"]');
 pref("devtools.toolbox.sideEnabled", true);
 pref("devtools.toolbox.zoomValue", "1");
 
 // Toolbox Button preferences
 pref("devtools.command-button-pick.enabled", true);
 pref("devtools.command-button-splitconsole.enabled", true);
 pref("devtools.command-button-paintflashing.enabled", false);
 pref("devtools.command-button-tilt.enabled", false);
 pref("devtools.command-button-scratchpad.enabled", false);
 pref("devtools.command-button-responsive.enabled", true);
 pref("devtools.command-button-eyedropper.enabled", false);
+pref("devtools.command-button-screenshot.enabled", false);
 
 // Inspector preferences
 // Enable the Inspector
 pref("devtools.inspector.enabled", true);
 // What was the last active sidebar in the inspector
 pref("devtools.inspector.activeSidebar", "ruleview");
 // Enable the markup preview
 pref("devtools.inspector.markupPreview", false);
--- a/browser/devtools/framework/toolbox.js
+++ b/browser/devtools/framework/toolbox.js
@@ -571,17 +571,18 @@ Toolbox.prototype = {
     // addons that have manually inserted toolbarbuttons into DOM.
     return [
       "command-button-pick",
       "command-button-splitconsole",
       "command-button-responsive",
       "command-button-paintflashing",
       "command-button-tilt",
       "command-button-scratchpad",
-      "command-button-eyedropper"
+      "command-button-eyedropper",
+      "command-button-screenshot"
     ].map(id => {
       let button = this.doc.getElementById(id);
       // Some buttons may not exist inside of Browser Toolbox
       if (!button) {
         return false;
       }
       return {
         id: id,
--- a/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties
+++ b/browser/locales/en-US/chrome/browser/devtools/gclicommands.properties
@@ -120,16 +120,19 @@ screenshotSavedToFile=Saved to
 # LOCALIZATION NOTE (screenshotErrorCopying) Text displayed to user upon
 # encountering error while copying the screenshot to clipboard.
 screenshotErrorCopying=Error occurred while copying to clipboard.
 
 # LOCALIZATION NOTE (screenshotCopied) Text displayed to user when the
 # screenshot is successfully copied to the clipboard.
 screenshotCopied=Copied to clipboard.
 
+# LOCALIZATION NOTE (screenshotTooltip) Text displayed as tooltip for screenshot button in devtools ToolBox.
+screenshotTooltip=Take a fullpage screenshot
+
 # LOCALIZATION NOTE (restartBrowserDesc) A very short description of the
 # 'restart' command. This string is designed to be shown in a menu alongside the
 # command name, which is why it should be as short as possible.
 # The argument (%1$S) is the browser name.
 restartBrowserDesc=Restart %1$S
 
 # LOCALIZATION NOTE (restartBrowserNocacheDesc) A very short string to
 # describe the 'nocache' parameter to the 'restart' command, which is
--- a/browser/themes/linux/jar.mn
+++ b/browser/themes/linux/jar.mn
@@ -194,16 +194,18 @@ browser.jar:
 * skin/classic/browser/devtools/widgets.css           (devtools/widgets.css)
   skin/classic/browser/devtools/filetype-dir-close.svg        (../shared/devtools/images/filetypes/dir-close.svg)
   skin/classic/browser/devtools/filetype-dir-open.svg         (../shared/devtools/images/filetypes/dir-open.svg)
   skin/classic/browser/devtools/filetype-globe.svg            (../shared/devtools/images/filetypes/globe.svg)
   skin/classic/browser/devtools/commandline-icon.png          (../shared/devtools/images/commandline-icon.png)
   skin/classic/browser/devtools/commandline-icon@2x.png       (../shared/devtools/images/commandline-icon@2x.png)
   skin/classic/browser/devtools/command-paintflashing.png     (../shared/devtools/images/command-paintflashing.png)
   skin/classic/browser/devtools/command-paintflashing@2x.png  (../shared/devtools/images/command-paintflashing@2x.png)
+  skin/classic/browser/devtools/command-screenshot.png        (../shared/devtools/images/command-screenshot.png)
+  skin/classic/browser/devtools/command-screenshot@2x.png     (../shared/devtools/images/command-screenshot@2x.png)
   skin/classic/browser/devtools/command-responsivemode.png    (../shared/devtools/images/command-responsivemode.png)
   skin/classic/browser/devtools/command-responsivemode@2x.png (../shared/devtools/images/command-responsivemode@2x.png)
   skin/classic/browser/devtools/command-scratchpad.png        (../shared/devtools/images/command-scratchpad.png)
   skin/classic/browser/devtools/command-scratchpad@2x.png     (../shared/devtools/images/command-scratchpad@2x.png)
   skin/classic/browser/devtools/command-tilt.png              (../shared/devtools/images/command-tilt.png)
   skin/classic/browser/devtools/command-tilt@2x.png           (../shared/devtools/images/command-tilt@2x.png)
   skin/classic/browser/devtools/command-pick.png              (../shared/devtools/images/command-pick.png)
   skin/classic/browser/devtools/command-pick@2x.png           (../shared/devtools/images/command-pick@2x.png)
--- a/browser/themes/osx/jar.mn
+++ b/browser/themes/osx/jar.mn
@@ -311,16 +311,18 @@ browser.jar:
 * skin/classic/browser/devtools/widgets.css                 (devtools/widgets.css)
   skin/classic/browser/devtools/filetype-dir-close.svg      (../shared/devtools/images/filetypes/dir-close.svg)
   skin/classic/browser/devtools/filetype-dir-open.svg       (../shared/devtools/images/filetypes/dir-open.svg)
   skin/classic/browser/devtools/filetype-globe.svg          (../shared/devtools/images/filetypes/globe.svg)
   skin/classic/browser/devtools/commandline-icon.png        (../shared/devtools/images/commandline-icon.png)
   skin/classic/browser/devtools/commandline-icon@2x.png     (../shared/devtools/images/commandline-icon@2x.png)
   skin/classic/browser/devtools/command-paintflashing.png     (../shared/devtools/images/command-paintflashing.png)
   skin/classic/browser/devtools/command-paintflashing@2x.png  (../shared/devtools/images/command-paintflashing@2x.png)
+  skin/classic/browser/devtools/command-screenshot.png        (../shared/devtools/images/command-screenshot.png)
+  skin/classic/browser/devtools/command-screenshot@2x.png     (../shared/devtools/images/command-screenshot@2x.png)
   skin/classic/browser/devtools/command-responsivemode.png    (../shared/devtools/images/command-responsivemode.png)
   skin/classic/browser/devtools/command-responsivemode@2x.png (../shared/devtools/images/command-responsivemode@2x.png)
   skin/classic/browser/devtools/command-scratchpad.png        (../shared/devtools/images/command-scratchpad.png)
   skin/classic/browser/devtools/command-scratchpad@2x.png     (../shared/devtools/images/command-scratchpad@2x.png)
   skin/classic/browser/devtools/command-tilt.png              (../shared/devtools/images/command-tilt.png)
   skin/classic/browser/devtools/command-tilt@2x.png           (../shared/devtools/images/command-tilt@2x.png)
   skin/classic/browser/devtools/command-pick.png              (../shared/devtools/images/command-pick.png)
   skin/classic/browser/devtools/command-pick@2x.png           (../shared/devtools/images/command-pick@2x.png)
new file mode 100644
index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..f6da8e949f9ea84c129a4ad2bb510eb22bb925df
GIT binary patch
literal 1202
zc%17D@N?(olHy`uVBq!ia0vp^4nQox!3HFkJ+IURQj#UE5hcO-X(i=}MX3yqDfvmM
z3ZA)%>8U}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VEksod;Xct4>14s
zbHM`sd09ZM?84j381I<{>hnB(A$-=o+93I~dxN&dFW31@nT=nLU2dor%bi@;@h$()
zo>k&Ny@wZXp3G_B`RhTXgqiSuk9g1Li)4Y?8a7Pk+_3nJ(R4@EOM)-ex9?mdt1db<
z_`K-L#Tm|@FUl#rNnuI}omsww_uci3mjaWQd32Xf(>z&l{d{HE&TBwta70_*wfK=9
z7w;x%Zl_SIuDkrs|7*p!oPc`I+_-hBD3;Oxm}Gi(T;sFFwlg-G8XquC4>h`zccuE0
zhP-w0>^YTNZ>XOw5WRhBmKewvso7}_lMJjqqLh6n#BEgDksILP#ry8(_2dsAKL>A9
zW9&QnarcT}LQZbx^SyU(o9O_w$mixPmI>0Fi#2PH8?9S=)VrS%B6{sUbIG;|73UlK
zzfCxKZN`M?$(dJQbXvSS`_O&C&kX)$IlfFi-H&yHcKYo%nt$0Z{1(hGjjp<Ps)yAt
zDZb=?J>hoVk-goPJa)7Cza^Zy_J(;!>64N#1*<PLh8eA!owtGQE3b+C+k;cq>bi*8
zF5e`$@7Q*W%2hze8UrKfj?YKcRr?$|f`1*IQ|T?a*?ao)2aADLr{&Dw-nezgGudUy
zap_h8^642DlTS^)zh)s&PN2+KUS7m#nfPmvbBa<=zxuTC(I!7>p#2Pq>cR=8tLk!-
zWW@u&9&P0T+RS*U?{GcyZR<nz%+5?L9Gn7+av$$!U}l(Iop9;*^-^9?k?-m1=d#Wz
Gp$PyDba}A=
--- a/browser/themes/shared/devtools/toolbars.inc.css
+++ b/browser/themes/shared/devtools/toolbars.inc.css
@@ -549,16 +549,20 @@
 .command-button[checked=true] > image {
   background-position: -48px center;
 }
 
 #command-button-paintflashing > image {
   background-image: url("chrome://browser/skin/devtools/command-paintflashing.png");
 }
 
+#command-button-screenshot > image {
+  background-image: url("chrome://browser/skin/devtools/command-screenshot.png");
+}
+
 #command-button-responsive > image {
   background-image: url("chrome://browser/skin/devtools/command-responsivemode.png");
 }
 
 #command-button-tilt > image {
   background-image: url("chrome://browser/skin/devtools/command-tilt.png");
 }
 
@@ -579,16 +583,20 @@
   background-image: url("chrome://browser/skin/devtools/command-eyedropper.png");
 }
 
 @media (min-resolution: 2dppx) {
   #command-button-paintflashing > image {
     background-image: url("chrome://browser/skin/devtools/command-paintflashing@2x.png");
   }
 
+  #command-button-screenshot > image {
+    background-image: url("chrome://browser/skin/devtools/command-screenshot@2x.png");
+  }
+
   #command-button-responsive > image {
     background-image: url("chrome://browser/skin/devtools/command-responsivemode@2x.png");
   }
 
   #command-button-tilt > image {
     background-image: url("chrome://browser/skin/devtools/command-tilt@2x.png");
   }
 
--- a/browser/themes/windows/jar.mn
+++ b/browser/themes/windows/jar.mn
@@ -235,16 +235,18 @@ browser.jar:
         skin/classic/browser/devtools/commandline-icon.png          (../shared/devtools/images/commandline-icon.png)
         skin/classic/browser/devtools/commandline-icon@2x.png          (../shared/devtools/images/commandline-icon@2x.png)
         skin/classic/browser/devtools/alerticon-warning.png         (../shared/devtools/images/alerticon-warning.png)
         skin/classic/browser/devtools/alerticon-warning@2x.png      (../shared/devtools/images/alerticon-warning@2x.png)
 *       skin/classic/browser/devtools/ruleview.css                  (../shared/devtools/ruleview.css)
         skin/classic/browser/devtools/commandline.css               (devtools/commandline.css)
         skin/classic/browser/devtools/command-paintflashing.png     (../shared/devtools/images/command-paintflashing.png)
         skin/classic/browser/devtools/command-paintflashing@2x.png  (../shared/devtools/images/command-paintflashing@2x.png)
+        skin/classic/browser/devtools/command-screenshot.png        (../shared/devtools/images/command-screenshot.png)
+        skin/classic/browser/devtools/command-screenshot@2x.png     (../shared/devtools/images/command-screenshot@2x.png)
         skin/classic/browser/devtools/command-responsivemode.png    (../shared/devtools/images/command-responsivemode.png)
         skin/classic/browser/devtools/command-responsivemode@2x.png (../shared/devtools/images/command-responsivemode@2x.png)
         skin/classic/browser/devtools/command-scratchpad.png        (../shared/devtools/images/command-scratchpad.png)
         skin/classic/browser/devtools/command-scratchpad@2x.png     (../shared/devtools/images/command-scratchpad@2x.png)
         skin/classic/browser/devtools/command-tilt.png              (../shared/devtools/images/command-tilt.png)
         skin/classic/browser/devtools/command-tilt@2x.png           (../shared/devtools/images/command-tilt@2x.png)
         skin/classic/browser/devtools/command-pick.png              (../shared/devtools/images/command-pick.png)
         skin/classic/browser/devtools/command-pick@2x.png           (../shared/devtools/images/command-pick@2x.png)
@@ -624,16 +626,18 @@ browser.jar:
 *       skin/classic/aero/browser/devtools/widgets.css               (devtools/widgets.css)
         skin/classic/aero/browser/devtools/filetype-dir-close.svg    (../shared/devtools/images/filetypes/dir-close.svg)
         skin/classic/aero/browser/devtools/filetype-dir-open.svg     (../shared/devtools/images/filetypes/dir-open.svg)
         skin/classic/aero/browser/devtools/filetype-globe.svg        (../shared/devtools/images/filetypes/globe.svg)
         skin/classic/aero/browser/devtools/commandline-icon.png      (../shared/devtools/images/commandline-icon.png)
         skin/classic/aero/browser/devtools/commandline-icon@2x.png      (../shared/devtools/images/commandline-icon@2x.png)
         skin/classic/aero/browser/devtools/command-paintflashing.png    (../shared/devtools/images/command-paintflashing.png)
         skin/classic/aero/browser/devtools/command-paintflashing@2x.png (../shared/devtools/images/command-paintflashing@2x.png)
+        skin/classic/aero/browser/devtools/command-screenshot.png    (../shared/devtools/images/command-screenshot.png)
+        skin/classic/aero/browser/devtools/command-screenshot@2x.png (../shared/devtools/images/command-screenshot@2x.png)
         skin/classic/aero/browser/devtools/command-responsivemode.png    (../shared/devtools/images/command-responsivemode.png)
         skin/classic/aero/browser/devtools/command-responsivemode@2x.png (../shared/devtools/images/command-responsivemode@2x.png)
         skin/classic/aero/browser/devtools/command-scratchpad.png    (../shared/devtools/images/command-scratchpad.png)
         skin/classic/aero/browser/devtools/command-scratchpad@2x.png (../shared/devtools/images/command-scratchpad@2x.png)
         skin/classic/aero/browser/devtools/command-tilt.png          (../shared/devtools/images/command-tilt.png)
         skin/classic/aero/browser/devtools/command-tilt@2x.png       (../shared/devtools/images/command-tilt@2x.png)
         skin/classic/aero/browser/devtools/command-pick.png          (../shared/devtools/images/command-pick.png)
         skin/classic/aero/browser/devtools/command-pick@2x.png       (../shared/devtools/images/command-pick@2x.png)
--- a/toolkit/devtools/gcli/commands/screenshot.js
+++ b/toolkit/devtools/gcli/commands/screenshot.js
@@ -22,16 +22,19 @@ const BRAND_SHORT_NAME = Cc["@mozilla.or
 const FILENAME_DEFAULT_VALUE = " ";
 
 exports.items = [
   {
     name: "screenshot",
     description: gcli.lookup("screenshotDesc"),
     manual: gcli.lookup("screenshotManual"),
     returnType: "dom",
+    buttonId: "command-button-screenshot",
+    buttonClass: "command-button command-button-invertable",
+    tooltipText: gcli.lookup("screenshotTooltip"),
     params: [
       {
         name: "filename",
         type: "string",
         defaultValue: FILENAME_DEFAULT_VALUE,
         description: gcli.lookup("screenshotFilenameDesc"),
         manual: gcli.lookup("screenshotFilenameManual")
       },