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/browser/extensions/extension_menu_manager.h" | 5 #include "chrome/browser/extensions/extension_menu_manager.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/json/json_writer.h" | 9 #include "base/json/json_writer.h" |
10 #include "base/logging.h" | 10 #include "base/logging.h" |
(...skipping 442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
453 (item->type() == ExtensionMenuItem::RADIO) ? true : !was_checked; | 453 (item->type() == ExtensionMenuItem::RADIO) ? true : !was_checked; |
454 | 454 |
455 item->SetChecked(checked); | 455 item->SetChecked(checked); |
456 properties->SetBoolean("checked", item->checked()); | 456 properties->SetBoolean("checked", item->checked()); |
457 } | 457 } |
458 | 458 |
459 std::string json_args; | 459 std::string json_args; |
460 base::JSONWriter::Write(&args, false, &json_args); | 460 base::JSONWriter::Write(&args, false, &json_args); |
461 std::string event_name = "contextMenus"; | 461 std::string event_name = "contextMenus"; |
462 event_router->DispatchEventToExtension( | 462 event_router->DispatchEventToExtension( |
463 item->extension_id(), event_name, json_args, profile, GURL()); | 463 item->extension_id(), event_name, json_args, profile, GURL(), true); |
Aaron Boodman
2012/02/03 20:18:47
If you don't use an enum, change this to a named c
Greg Billock
2012/02/06 22:58:01
Done.
| |
464 } | 464 } |
465 | 465 |
466 void ExtensionMenuManager::SanitizeRadioList( | 466 void ExtensionMenuManager::SanitizeRadioList( |
467 const ExtensionMenuItem::List& item_list) { | 467 const ExtensionMenuItem::List& item_list) { |
468 ExtensionMenuItem::List::const_iterator i = item_list.begin(); | 468 ExtensionMenuItem::List::const_iterator i = item_list.begin(); |
469 while (i != item_list.end()) { | 469 while (i != item_list.end()) { |
470 if ((*i)->type() != ExtensionMenuItem::RADIO) { | 470 if ((*i)->type() != ExtensionMenuItem::RADIO) { |
471 ++i; | 471 ++i; |
472 break; | 472 break; |
473 } | 473 } |
(...skipping 92 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
566 if (profile < other.profile) | 566 if (profile < other.profile) |
567 return true; | 567 return true; |
568 if (profile == other.profile) { | 568 if (profile == other.profile) { |
569 if (extension_id < other.extension_id) | 569 if (extension_id < other.extension_id) |
570 return true; | 570 return true; |
571 if (extension_id == other.extension_id) | 571 if (extension_id == other.extension_id) |
572 return uid < other.uid; | 572 return uid < other.uid; |
573 } | 573 } |
574 return false; | 574 return false; |
575 } | 575 } |
OLD | NEW |