| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "chrome/common/extensions/command.h" | 5 #include "chrome/common/extensions/command.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "base/strings/string_number_conversions.h" | 8 #include "base/strings/string_number_conversions.h" |
| 9 #include "base/strings/string_split.h" | 9 #include "base/strings/string_split.h" |
| 10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
| (...skipping 254 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 265 return suggestion; | 265 return suggestion; |
| 266 | 266 |
| 267 std::vector<std::string> tokens; | 267 std::vector<std::string> tokens; |
| 268 base::SplitString(suggestion, '+', &tokens); | 268 base::SplitString(suggestion, '+', &tokens); |
| 269 for (size_t i = 0; i < tokens.size(); i++) { | 269 for (size_t i = 0; i < tokens.size(); i++) { |
| 270 if (tokens[i] == values::kKeyCtrl) | 270 if (tokens[i] == values::kKeyCtrl) |
| 271 tokens[i] = values::kKeyCommand; | 271 tokens[i] = values::kKeyCommand; |
| 272 else if (tokens[i] == values::kKeyMacCtrl) | 272 else if (tokens[i] == values::kKeyMacCtrl) |
| 273 tokens[i] = values::kKeyCtrl; | 273 tokens[i] = values::kKeyCtrl; |
| 274 } | 274 } |
| 275 return base::JoinString(tokens, "+"); | 275 return JoinString(tokens, '+'); |
| 276 } | 276 } |
| 277 | 277 |
| 278 } // namespace | 278 } // namespace |
| 279 | 279 |
| 280 Command::Command() : global_(false) {} | 280 Command::Command() : global_(false) {} |
| 281 | 281 |
| 282 Command::Command(const std::string& command_name, | 282 Command::Command(const std::string& command_name, |
| 283 const base::string16& description, | 283 const base::string16& description, |
| 284 const std::string& accelerator, | 284 const std::string& accelerator, |
| 285 bool global) | 285 bool global) |
| (...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 546 accelerator_ = accelerator; | 546 accelerator_ = accelerator; |
| 547 command_name_ = command_name; | 547 command_name_ = command_name; |
| 548 description_ = description; | 548 description_ = description; |
| 549 global_ = global; | 549 global_ = global; |
| 550 } | 550 } |
| 551 } | 551 } |
| 552 return true; | 552 return true; |
| 553 } | 553 } |
| 554 | 554 |
| 555 } // namespace extensions | 555 } // namespace extensions |
| OLD | NEW |