diff options
author | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-21 07:20:26 +0000 |
---|---|---|
committer | vitalybuka@chromium.org <vitalybuka@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2013-11-21 07:20:26 +0000 |
commit | 3192bc911a93fd0d2fab4f039a2e28941227ec7d (patch) | |
tree | 7fc50f04c6b20f2e5a4e862fd30d41ae4aaab9fe /cloud_print | |
parent | af6be6e4fb322e47ac335389e32a3415bb804eda (diff) | |
download | chromium_src-3192bc911a93fd0d2fab4f039a2e28941227ec7d.zip chromium_src-3192bc911a93fd0d2fab4f039a2e28941227ec7d.tar.gz chromium_src-3192bc911a93fd0d2fab4f039a2e28941227ec7d.tar.bz2 |
Fixed serial number, service name and firmware version of GCP 2.0 prototype.
Review URL: https://codereview.chromium.org/77343003
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@236434 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'cloud_print')
-rw-r--r-- | cloud_print/cloud_print.gyp | 47 | ||||
-rw-r--r-- | cloud_print/cloud_print_resources.gyp | 109 | ||||
-rw-r--r-- | cloud_print/gcp20/prototype/gcp20_device.gyp | 1 | ||||
-rw-r--r-- | cloud_print/gcp20/prototype/printer.cc | 25 | ||||
-rw-r--r-- | cloud_print/service/win/resources/setup_dialog.rc | 2 | ||||
-rw-r--r-- | cloud_print/virtual_driver/win/install/virtual_driver_install.gyp | 2 | ||||
-rw-r--r-- | cloud_print/virtual_driver/win/virtual_driver.gypi | 2 |
7 files changed, 130 insertions, 58 deletions
diff --git a/cloud_print/cloud_print.gyp b/cloud_print/cloud_print.gyp index cf3c543..7d1b3ce 100644 --- a/cloud_print/cloud_print.gyp +++ b/cloud_print/cloud_print.gyp @@ -4,56 +4,9 @@ { 'variables': { 'chromium_code': 1, - - 'variables': { - 'version_py_path': '../tools/build/version.py', - 'version_path': 'VERSION', - }, - 'version_py_path': '<(version_py_path) -f', - 'version_path': '<(version_path)', }, - 'includes': [ - '../chrome/version.gypi', - ], 'targets': [ { - 'target_name': 'cloud_print_version_resources', - 'type': 'none', - 'conditions': [ - ['branding == "Chrome"', { - 'variables': { - 'branding_path': '<(DEPTH)/chrome/app/theme/google_chrome/BRANDING', - }, - }, { # else branding!="Chrome" - 'variables': { - 'branding_path': '<(DEPTH)/chrome/app/theme/chromium/BRANDING', - }, - }], - ], - 'variables': { - 'output_dir': 'cloud_print', - 'template_input_path': '../chrome/app/chrome_version.rc.version', - 'extra_variable_files_arguments': [ '-f', 'BRANDING' ], - 'extra_variable_files': [ 'BRANDING' ], # NOTE: matches that above - }, - 'direct_dependent_settings': { - 'include_dirs': [ - '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)', - ], - }, - 'sources': [ - 'service/win/cloud_print_service_exe.ver', - 'service/win/cloud_print_service_config_exe.ver', - 'service/win/cloud_print_service_setup_exe.ver', - 'virtual_driver/win/gcp_portmon64_dll.ver', - 'virtual_driver/win/gcp_portmon_dll.ver', - 'virtual_driver/win/install/virtual_driver_setup_exe.ver', - ], - 'includes': [ - '../chrome/version_resource_rules.gypi', - ], - }, - { 'target_name': 'cloud_print', 'type': 'none', 'dependencies': [ diff --git a/cloud_print/cloud_print_resources.gyp b/cloud_print/cloud_print_resources.gyp new file mode 100644 index 0000000..1eaaaec --- /dev/null +++ b/cloud_print/cloud_print_resources.gyp @@ -0,0 +1,109 @@ +# Copyright 2013 The Chromium Authors. All rights reserved. +# Use of this source code is governed by a BSD-style license that can be +# found in the LICENSE file. +{ + 'variables': { + 'chromium_code': 1, + + 'variables': { + 'version_py_path': '../tools/build/version.py', + 'version_path': 'VERSION', + }, + 'version_py_path': '<(version_py_path) -f', + 'version_path': '<(version_path)', + }, + 'includes': [ + '../chrome/version.gypi', + ], + 'targets': [ + { + 'target_name': 'cloud_print_version_resources', + 'type': 'none', + 'conditions': [ + ['branding == "Chrome"', { + 'variables': { + 'branding_path': '<(DEPTH)/chrome/app/theme/google_chrome/BRANDING', + }, + }, { # else branding!="Chrome" + 'variables': { + 'branding_path': '<(DEPTH)/chrome/app/theme/chromium/BRANDING', + }, + }], + ], + 'variables': { + 'output_dir': 'cloud_print', + 'template_input_path': '../chrome/app/chrome_version.rc.version', + 'extra_variable_files_arguments': [ '-f', 'BRANDING' ], + 'extra_variable_files': [ 'BRANDING' ], # NOTE: matches that above + }, + 'direct_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)', + ], + }, + 'sources': [ + 'service/win/cloud_print_service_exe.ver', + 'service/win/cloud_print_service_config_exe.ver', + 'service/win/cloud_print_service_setup_exe.ver', + 'virtual_driver/win/gcp_portmon64_dll.ver', + 'virtual_driver/win/gcp_portmon_dll.ver', + 'virtual_driver/win/install/virtual_driver_setup_exe.ver', + ], + 'includes': [ + '../chrome/version_resource_rules.gypi', + ], + }, + { + 'target_name': 'cloud_print_version_header', + 'type': 'none', + 'conditions': [ + ['branding == "Chrome"', { + 'variables': { + 'branding_path': '<(DEPTH)/chrome/app/theme/google_chrome/BRANDING', + }, + }, { # else branding!="Chrome" + 'variables': { + 'branding_path': '<(DEPTH)/chrome/app/theme/chromium/BRANDING', + }, + }], + ], + 'hard_dependency': 1, + 'actions': [ + { + 'action_name': 'version_header', + 'variables': { + 'output_dir': 'cloud_print', + 'lastchange_path': + '<(DEPTH)/build/util/LASTCHANGE', + }, + 'direct_dependent_settings': { + 'include_dirs': [ + '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)', + ], + }, + 'inputs': [ + '<(version_path)', + '<(branding_path)', + '<(lastchange_path)', + '<(DEPTH)/chrome/version.h.in', + 'BRANDING', + ], + 'outputs': [ + '<(SHARED_INTERMEDIATE_DIR)/<(output_dir)/version.h', + ], + 'action': [ + 'python', + '<(version_py_path)', + '-f', '<(version_path)', + '-f', '<(branding_path)', + '-f', '<(lastchange_path)', + '-f', 'BRANDING', + '<(DEPTH)/chrome/version.h.in', + '<@(_outputs)', + ], + 'message': 'Generating version header file: <@(_outputs)', + }, + ], + }, + ], +} diff --git a/cloud_print/gcp20/prototype/gcp20_device.gyp b/cloud_print/gcp20/prototype/gcp20_device.gyp index 0952344..c47012a 100644 --- a/cloud_print/gcp20/prototype/gcp20_device.gyp +++ b/cloud_print/gcp20/prototype/gcp20_device.gyp @@ -21,6 +21,7 @@ 'dependencies': [ '<(DEPTH)/base/base.gyp:base', '<(DEPTH)/base/third_party/dynamic_annotations/dynamic_annotations.gyp:dynamic_annotations', + '<(DEPTH)/cloud_print/cloud_print_resources.gyp:cloud_print_version_header', '<(DEPTH)/google_apis/google_apis.gyp:google_apis', '<(DEPTH)/jingle/jingle.gyp:notifier', '<(DEPTH)/net/net.gyp:http_server', diff --git a/cloud_print/gcp20/prototype/printer.cc b/cloud_print/gcp20/prototype/printer.cc index 7c4141e..11b4f41 100644 --- a/cloud_print/gcp20/prototype/printer.cc +++ b/cloud_print/gcp20/prototype/printer.cc @@ -21,6 +21,7 @@ #include "cloud_print/gcp20/prototype/local_settings.h" #include "cloud_print/gcp20/prototype/service_parameters.h" #include "cloud_print/gcp20/prototype/special_io.h" +#include "cloud_print/version.h" #include "net/base/net_util.h" #include "net/base/url_util.h" @@ -127,6 +128,14 @@ net::IPAddressNumber GetLocalIp(const std::string& interface_name, return net::IPAddressNumber(); } +std::string GetDescription() { + std::string result = kPrinterDescription; + net::IPAddressNumber ip = GetLocalIp("", false); + if (!ip.empty()) + result += " at " + net::IPAddressToString(ip); + return result; +} + scoped_refptr<base::SingleThreadTaskRunner> GetTaskRunner() { return base::MessageLoop::current()->message_loop_proxy(); } @@ -323,19 +332,18 @@ void Printer::CreateInfo(PrivetHttpServer::DeviceInfo* info) { CheckRegistrationExpiration(); // TODO(maksymb): Replace "text" with constants. - *info = PrivetHttpServer::DeviceInfo(); info->version = "1.0"; info->name = kPrinterName; - info->description = kPrinterDescription; + info->description = GetDescription(); info->url = kCloudPrintUrl; info->id = state_.device_id; info->device_state = "idle"; info->connection_state = ConnectionStateToString(connection_state_); - info->manufacturer = "Google"; - info->model = "Prototype"; - info->serial_number = "2.3.5.7.13.17.19.31.61.89.107.127.521.607.1279.2203"; - info->firmware = "3.7.31.127.8191.131071.524287.2147483647"; + info->manufacturer = COMPANY_FULLNAME_STRING; + info->model = "Prototype r" + std::string(LASTCHANGE_STRING); + info->serial_number = "20CB5FF2-B28C-4EFA-8DCD-516CFF0455A2"; + info->firmware = CHROME_VERSION_STRING; info->uptime = static_cast<int>((base::Time::Now() - starttime_).InSeconds()); info->x_privet_token = xtoken_.GenerateXToken(); @@ -729,7 +737,7 @@ std::vector<std::string> Printer::CreateTxt() const { std::vector<std::string> txt; txt.push_back("txtvers=1"); txt.push_back("ty=" + std::string(kPrinterName)); - txt.push_back("note=" + std::string(kPrinterDescription)); + txt.push_back("note=" + std::string(GetDescription())); txt.push_back("url=" + std::string(kCloudPrintUrl)); txt.push_back("type=printer"); txt.push_back("id=" + state_.device_id); @@ -822,7 +830,8 @@ bool Printer::StartDnsServer() { uint16 port = command_line_reader::ReadHttpPort(kHttpPortDefault); std::string service_name_prefix = - command_line_reader::ReadServiceNamePrefix(kServiceNamePrefixDefault); + command_line_reader::ReadServiceNamePrefix(net::IPAddressToString(ip) + + kServiceNamePrefixDefault); std::string service_domain_name = command_line_reader::ReadDomainName(kServiceDomainNameDefault); diff --git a/cloud_print/service/win/resources/setup_dialog.rc b/cloud_print/service/win/resources/setup_dialog.rc index bbeb996..aaf2952 100644 --- a/cloud_print/service/win/resources/setup_dialog.rc +++ b/cloud_print/service/win/resources/setup_dialog.rc @@ -5,9 +5,9 @@ #include "grit\\generated_resources.h" #define APSTUDIO_READONLY_SYMBOLS +#include "cloud_print/version.h" #include "winres.h" #include "verrsrc.h" -#include "version.h" #undef APSTUDIO_READONLY_SYMBOLS #ifdef APSTUDIO_INVOKED diff --git a/cloud_print/virtual_driver/win/install/virtual_driver_install.gyp b/cloud_print/virtual_driver/win/install/virtual_driver_install.gyp index 6180806..70d14b6 100644 --- a/cloud_print/virtual_driver/win/install/virtual_driver_install.gyp +++ b/cloud_print/virtual_driver/win/install/virtual_driver_install.gyp @@ -23,7 +23,7 @@ '../virtual_driver.gyp:virtual_driver_lib', '<(DEPTH)/base/base.gyp:base', '<(DEPTH)/cloud_print/common/common.gyp:cloud_print_install_lib', - '<(DEPTH)/cloud_print/cloud_print.gyp:cloud_print_version_resources', + '<(DEPTH)/cloud_print/cloud_print_resources.gyp:cloud_print_version_resources', 'virtual_driver_setup_resources', ], 'sources': [ diff --git a/cloud_print/virtual_driver/win/virtual_driver.gypi b/cloud_print/virtual_driver/win/virtual_driver.gypi index 80c0ffb..41b2a97 100644 --- a/cloud_print/virtual_driver/win/virtual_driver.gypi +++ b/cloud_print/virtual_driver/win/virtual_driver.gypi @@ -49,7 +49,7 @@ 'dependencies': [ 'gcp_portmon_lib<(virtual_driver_suffix)', '<(DEPTH)/chrome/chrome.gyp:chrome_version_header', - '<(DEPTH)/cloud_print/cloud_print.gyp:cloud_print_version_resources', + '<(DEPTH)/cloud_print/cloud_print_resources.gyp:cloud_print_version_resources', ], 'include_dirs': [ # To allow including "version.h" |