Bug 1494170: Show device name for Android. r=jdescottes
☠☠ backed out by bca1787fc4d3 ☠ ☠
authorDaisuke Akatsuka <dakatsuka@mozilla.com>
Mon, 01 Oct 2018 07:58:51 +0000
changeset 494681 8887f8ebc3762747f2d3faa91506ec896e8acc41
parent 494680 fc1300333ea26423259c02293b9274a9e8c7789e
child 494682 51b6727d7abd41c1a34ed921bf640a413126258a
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdescottes
bugs1494170
milestone64.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 1494170: Show device name for Android. r=jdescottes Depends on D7037 Differential Revision: https://phabricator.services.mozilla.com/D7038
devtools/client/aboutdebugging-new/src/actions/runtimes.js
devtools/client/aboutdebugging-new/src/components/RuntimeInfo.js
devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js
devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
--- a/devtools/client/aboutdebugging-new/src/actions/runtimes.js
+++ b/devtools/client/aboutdebugging-new/src/actions/runtimes.js
@@ -61,38 +61,40 @@ async function createClientForRuntime(ru
     return createNetworkClient(host, port);
   } else if (type === RUNTIMES.USB) {
     return createUSBClient(runtime.socketPath);
   }
 
   return null;
 }
 
-async function getRuntimeInfo(client) {
+async function getRuntimeInfo(runtime, client) {
+  const { model } = runtime;
   const deviceFront = await client.mainRoot.getFront("device");
   const { brandName: name, channel, version } = await deviceFront.getDescription();
   const icon =
     (channel === "release" || channel === "beta" || channel === "aurora")
       ? `chrome://devtools/skin/images/aboutdebugging-firefox-${ channel }.svg`
       : "chrome://devtools/skin/images/aboutdebugging-firefox-nightly.svg";
 
   return {
     icon,
+    model,
     name,
     version,
   };
 }
 
 function connectRuntime(id) {
   return async (dispatch, getState) => {
     dispatch({ type: CONNECT_RUNTIME_START });
     try {
       const runtime = findRuntimeById(id, getState().runtimes);
       const client = await createClientForRuntime(runtime);
-      const info = await getRuntimeInfo(client);
+      const info = await getRuntimeInfo(runtime, client);
 
       dispatch({
         type: CONNECT_RUNTIME_SUCCESS,
         runtime: {
           id,
           client,
           info,
           type: runtime.type,
--- a/devtools/client/aboutdebugging-new/src/components/RuntimeInfo.js
+++ b/devtools/client/aboutdebugging-new/src/components/RuntimeInfo.js
@@ -1,41 +1,54 @@
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 "use strict";
 
-const { PureComponent } = require("devtools/client/shared/vendor/react");
+const { createFactory, PureComponent } = require("devtools/client/shared/vendor/react");
 const dom = require("devtools/client/shared/vendor/react-dom-factories");
 const PropTypes = require("devtools/client/shared/vendor/react-prop-types");
 
+const FluentReact = require("devtools/client/shared/vendor/fluent-react");
+const Localized = createFactory(FluentReact.Localized);
+
 /**
  * This component displays runtime information.
  */
 class RuntimeInfo extends PureComponent {
   static get propTypes() {
     return {
       icon: PropTypes.string.isRequired,
+      model: PropTypes.string,
       name: PropTypes.string.isRequired,
       version: PropTypes.string.isRequired,
     };
   }
 
   render() {
-    const { icon, name, version } = this.props;
+    const { icon, model, name, version } = this.props;
 
     return dom.h1(
       {
         className: "runtime-info",
       },
       dom.img(
         {
           className: "runtime-info__icon",
           src: icon,
         }
       ),
-      `${ name } (${ version })`
+      Localized(
+        {
+          id: model ? "about-debugging-runtime-info-with-model"
+                    : "about-debugging-runtime-info",
+          $name: name,
+          $model: model,
+          $version: version,
+        },
+        dom.label({}, `${ name } on ${ model } (${ version })`)
+      )
     );
   }
 }
 
 module.exports = RuntimeInfo;
--- a/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js
+++ b/devtools/client/aboutdebugging-new/src/reducers/runtimes-state.js
@@ -91,16 +91,17 @@ function runtimesReducer(state = Runtime
       return Object.assign({}, state, { selectedRuntimeId: null });
     }
 
     case USB_RUNTIMES_UPDATED: {
       const { runtimes } = action;
       const usbRuntimes = runtimes.map(runtime => {
         return {
           id: runtime.id,
+          model: runtime._model,
           name: runtime.name,
           socketPath: runtime._socketPath,
           type: RUNTIMES.USB,
         };
       });
       return Object.assign({}, state, { usbRuntimes });
     }
 
--- a/devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
+++ b/devtools/client/aboutdebugging-new/tmp-locale/en-US/aboutdebugging.notftl
@@ -159,8 +159,19 @@ about-debugging-worker-status-running = 
 
 # Displayed for service workers in runtime pages, for service workers in STOPPED state.
 about-debugging-worker-status-stopped = Stopped
 
 # Displayed for service workers in runtime pages, for service workers for which no
 # registration could be found yet. Only active registrations are visible from
 # about:debugging, so such service workers are considered as registering.
 about-debugging-worker-status-registering = Registering
+
+# Displayed for runtime info in runtime pages.
+# { $name } is brand name such as "Firefox Nightly"
+# { $version } is version such as "64.0a1"
+about-debugging-runtime-info = { $name } ({ $version })
+
+# Displayed for runtime info in runtime page when we display the model as well.
+# { $name } is brand name such as "Firefox Nightly"
+# { $version } is version such as "64.0a1"
+# { $model } is model name of device
+about-debugging-runtime-info-with-model = { $name } on { $model } ({ $version })