Skip to content

Commit

Permalink
Get rid of std::wstring version of HasSwitch.
Browse files Browse the repository at this point in the history
BUG=24672
TEST=trybots

Review URL: http://codereview.chromium.org/5649003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@68650 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
tfarina@chromium.org committed Dec 8, 2010
1 parent 3f40a6a commit 711a353
Show file tree
Hide file tree
Showing 11 changed files with 15 additions and 31 deletions.
7 changes: 0 additions & 7 deletions base/command_line.cc
Original file line number Diff line number Diff line change
Expand Up @@ -287,13 +287,6 @@ bool CommandLine::HasSwitch(const std::string& switch_string) const {
return switches_.find(lowercased_switch) != switches_.end();
}

#if defined(OS_WIN)
// Deprecated; still temporarily available on Windows.
bool CommandLine::HasSwitch(const std::wstring& switch_string) const {
return HasSwitch(WideToASCII(switch_string));
}
#endif

std::string CommandLine::GetSwitchValueASCII(
const std::string& switch_string) const {
CommandLine::StringType value = GetSwitchValueNative(switch_string);
Expand Down
7 changes: 0 additions & 7 deletions base/command_line.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,13 +161,6 @@ class CommandLine {
void CopySwitchesFrom(const CommandLine& source, const char* const switches[],
size_t count);

// APIs that work with wstrings are deprecated.
// TODO(evanm): remove all of these.
#if defined(OS_WIN)
// Deprecated on non-Windows.
bool HasSwitch(const std::wstring& switch_string) const;
#endif

private:
friend class InProcessBrowserTest;

Expand Down
4 changes: 2 additions & 2 deletions ceee/common/install_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ namespace installer_util {
// TODO(joi@chromium.org) Move to chrome/installer/util_constants.h
// when we refactor this logic to be in the installer rather than
// on the registration entrypoints.
const wchar_t kEnableCeee[] = L"enable-ceee";
const wchar_t kEnableFfCeee[] = L"enable-ff-ceee";
const char kEnableCeee[] = "enable-ceee";
const char kEnableFfCeee[] = "enable-ff-ceee";
}
}

Expand Down
2 changes: 1 addition & 1 deletion chrome/test/in_process_browser_test.cc
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ void InitializeBrowser(Browser* browser) {

extern int BrowserMain(const MainFunctionParams&);

const wchar_t kUnitTestShowWindows[] = L"show-windows";
const char kUnitTestShowWindows[] = "show-windows";

// Passed as value of kTestType.
static const char kBrowserTestType[] = "browser";
Expand Down
4 changes: 2 additions & 2 deletions chrome_frame/test/net/fake_external_tab.cc
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ namespace {

// A special command line switch to allow developers to manually launch the
// browser and debug CF inside the browser.
const wchar_t kManualBrowserLaunch[] = L"manual-browser";
const char kManualBrowserLaunch[] = "manual-browser";

// Pops up a message box after the test environment has been set up
// and before tearing it down. Useful for when debugging tests and not
// the test environment that's been set up.
const wchar_t kPromptAfterSetup[] = L"prompt-after-setup";
const char kPromptAfterSetup[] = "prompt-after-setup";

const int kTestServerPort = 4666;
// The test HTML we use to initialize Chrome Frame.
Expand Down
2 changes: 1 addition & 1 deletion chrome_frame/test/net/test_automation_provider.cc
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ namespace {

// A special command line switch to just run the unit tests without CF in
// the picture. Can be useful when the harness itself needs to be debugged.
const wchar_t kNoCfTestRun[] = L"no-cf-test-run";
const char kNoCfTestRun[] = "no-cf-test-run";

bool CFTestsDisabled() {
static bool switch_present = CommandLine::ForCurrentProcess()->
Expand Down
2 changes: 1 addition & 1 deletion chrome_frame/test/run_all_unittests.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class ChromeFrameUnittestsModule

ChromeFrameUnittestsModule _AtlModule;

const wchar_t kNoRegistrationSwitch[] = L"no-registration";
const char kNoRegistrationSwitch[] = "no-registration";

void PureCall() {
__debugbreak();
Expand Down
6 changes: 2 additions & 4 deletions gfx/canvas_direct2d_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,13 @@

namespace {

const char kVisibleModeFlag[] = "d2d-canvas-visible";

class TestWindow : public gfx::WindowImpl {
public:
static const int kWindowSize = 500;
static const int kWindowPosition = 10;

static const wchar_t* kVisibleModeFlag;

TestWindow() {
if (CommandLine::ForCurrentProcess()->HasSwitch(kVisibleModeFlag))
Expand Down Expand Up @@ -75,9 +76,6 @@ class TestWindow : public gfx::WindowImpl {
DISALLOW_COPY_AND_ASSIGN(TestWindow);
};

// static
const wchar_t* TestWindow::kVisibleModeFlag = L"d2d-canvas-visible";

// Loads a png data blob from the data resources associated with this
// executable, decodes it and returns a SkBitmap.
SkBitmap LoadBitmapFromResources(int resource_id) {
Expand Down
2 changes: 1 addition & 1 deletion media/tools/player_wtl/player_wtl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
// See player_wtl.h to enable timing code by turning on TESTING macro.

namespace switches {
const wchar_t* const kExit = L"exit";
const char kExit[] = "exit";
} // namespace switches

CAppModule g_module;
Expand Down
8 changes: 4 additions & 4 deletions net/tools/dump_cache/dump_cache.cc
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,16 @@ const char kInputPath[] = "input";
const char kOutputPath[] = "output";

// Dumps the file headers to stdout.
const wchar_t kDumpHeaders[] = L"dump-headers";
const char kDumpHeaders[] = "dump-headers";

// Dumps all entries to stdout.
const wchar_t kDumpContents[] = L"dump-contents";
const char kDumpContents[] = "dump-contents";

// Convert the cache to files.
const wchar_t kDumpToFiles[] = L"dump-to-files";
const char kDumpToFiles[] = "dump-to-files";

// Upgrade an old version to the current one.
const wchar_t kUpgrade[] = L"upgrade";
const char kUpgrade[] = "upgrade";

// Internal use:
const char kSlave[] = "slave";
Expand Down
2 changes: 1 addition & 1 deletion skia/ext/vector_canvas_unittest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ namespace skia {

namespace {

const wchar_t* const kGenerateSwitch = L"vector-canvas-generate";
const char kGenerateSwitch[] = "vector-canvas-generate";

// Lightweight HDC management.
class Context {
Expand Down

0 comments on commit 711a353

Please sign in to comment.