forked from sanyaade-mobiledev/chromium.src
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
GCP 2.0 prototype switches code cleanup.
TBR=gene@chromium.org Review URL: https://codereview.chromium.org/587103002 Cr-Commit-Position: refs/heads/master@{#295925}
- Loading branch information
1 parent
b44e7c8
commit 8e58411
Showing
8 changed files
with
120 additions
and
50 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,63 @@ | ||
// Copyright 2014 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. | ||
|
||
#include "cloud_print/gcp20/prototype/gcp20_switches.h" | ||
|
||
#include "base/files/file_path.h" | ||
#include "base/path_service.h" | ||
|
||
namespace switches { | ||
|
||
const char kDisableConfirmation[] = "disable-confirmation"; | ||
const char kDisableMethodCheck[] = "disable-method-check"; | ||
const char kDisableXTocken[] = "disable-x-token"; | ||
const char kDomainName[] = "domain-name"; | ||
const char kExtendedResponce[] = "extended-response"; | ||
const char kHelpShort[] = "h"; | ||
const char kHelp[] = "help"; | ||
const char kHttpPort[] = "http-port"; | ||
const char kNoAnnouncement[] = "no-announcement"; | ||
const char kServiceName[] = "service-name"; | ||
const char kSimulatePrintingErrors[] = "simulate-printing-errors"; | ||
const char kStatePath[] = "state-path"; | ||
const char kTtl[] = "ttl"; | ||
const char kUnicastRespond[] = "unicast-respond"; | ||
|
||
const struct { | ||
const char* const name; | ||
const char* const description; | ||
const char* const arg; | ||
} kHelpStrings[] = { | ||
{kDisableConfirmation, "disables confirmation of registration", NULL}, | ||
{kDisableMethodCheck, "disables HTTP method checking (POST, GET)", NULL}, | ||
{kDisableXTocken, "disables checking of X-Privet-Token HTTP header", NULL}, | ||
{kNoAnnouncement, "disables DNS announcements", NULL}, | ||
{kExtendedResponce, "responds to PTR with additional records", NULL}, | ||
{kSimulatePrintingErrors, "simulates some errors for local printing", NULL}, | ||
{kUnicastRespond, | ||
"DNS responses will be sent in unicast instead of multicast", NULL}, | ||
{kDomainName, "sets, should ends with '.local'", "DOMAIN"}, | ||
{kHttpPort, "sets port for HTTP server", "PORT"}, | ||
{kServiceName, "sets DNS service name", "SERVICE"}, | ||
{kStatePath, "sets path to file with registration state", "PATH"}, | ||
{kTtl, "sets TTL for DNS announcements", "TTL"}, | ||
}; | ||
|
||
void PrintUsage() { | ||
base::FilePath exe; | ||
PathService::Get(base::FILE_EXE, &exe); | ||
printf("usage: %s [OPTION]...\n\n", exe.BaseName().MaybeAsASCII().c_str()); | ||
for (size_t i = 0; i < arraysize(kHelpStrings); ++i) { | ||
std::string name = kHelpStrings[i].name; | ||
if (kHelpStrings[i].arg) { | ||
name += '='; | ||
name += kHelpStrings[i].arg; | ||
} | ||
name.resize(27, ' '); | ||
printf(" --%s%s\n", name.c_str(), kHelpStrings[i].description); | ||
} | ||
printf("\n WARNING: mDNS probing is not implemented\n"); | ||
} | ||
|
||
} // namespace switches |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
// Copyright 2014 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. | ||
|
||
#ifndef CLOUD_PRINT_GCP20_PROTOTYPE_GCP20_SWITCHES_H_ | ||
#define CLOUD_PRINT_GCP20_PROTOTYPE_GCP20_SWITCHES_H_ | ||
|
||
namespace switches { | ||
|
||
extern const char kDisableConfirmation[]; | ||
extern const char kDisableMethodCheck[]; | ||
extern const char kDisableXTocken[]; | ||
extern const char kDomainName[]; | ||
extern const char kExtendedResponce[]; | ||
extern const char kHelpShort[]; | ||
extern const char kHelp[]; | ||
extern const char kHttpPort[]; | ||
extern const char kNoAnnouncement[]; | ||
extern const char kServiceName[]; | ||
extern const char kSimulatePrintingErrors[]; | ||
extern const char kStatePath[]; | ||
extern const char kTtl[]; | ||
extern const char kUnicastRespond[]; | ||
|
||
void PrintUsage(); | ||
|
||
} // namespace switches | ||
|
||
#endif // CLOUD_PRINT_GCP20_PROTOTYPE_GCP20_SWITCHES_H_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters