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/menu_manager.h" | 5 #include "chrome/browser/extensions/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 625 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
636 properties->SetString("selectionText", params.selection_text); | 636 properties->SetString("selectionText", params.selection_text); |
637 | 637 |
638 properties->SetBoolean("editable", params.is_editable); | 638 properties->SetBoolean("editable", params.is_editable); |
639 | 639 |
640 args->Append(properties); | 640 args->Append(properties); |
641 | 641 |
642 // Add the tab info to the argument list. | 642 // Add the tab info to the argument list. |
643 // No tab info in a platform app. | 643 // No tab info in a platform app. |
644 if (!extension || !extension->is_platform_app()) { | 644 if (!extension || !extension->is_platform_app()) { |
645 // Note: web_contents only NULL in unit tests :( | 645 // Note: web_contents only NULL in unit tests :( |
646 if (web_contents) | 646 if (web_contents && extension) |
647 args->Append(ExtensionTabUtil::CreateTabValue(web_contents)); | 647 args->Append(ExtensionTabUtil::CreateTabValue(web_contents, extension)); |
648 else | 648 else |
649 args->Append(new DictionaryValue()); | 649 args->Append(new DictionaryValue()); |
650 } | 650 } |
651 | 651 |
652 if (item->type() == MenuItem::CHECKBOX || | 652 if (item->type() == MenuItem::CHECKBOX || |
653 item->type() == MenuItem::RADIO) { | 653 item->type() == MenuItem::RADIO) { |
654 bool was_checked = item->checked(); | 654 bool was_checked = item->checked(); |
655 properties->SetBoolean("wasChecked", was_checked); | 655 properties->SetBoolean("wasChecked", was_checked); |
656 | 656 |
657 // RADIO items always get set to true when you click on them, but CHECKBOX | 657 // RADIO items always get set to true when you click on them, but CHECKBOX |
(...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
841 if (uid < other.uid) | 841 if (uid < other.uid) |
842 return true; | 842 return true; |
843 if (uid == other.uid) | 843 if (uid == other.uid) |
844 return string_uid < other.string_uid; | 844 return string_uid < other.string_uid; |
845 } | 845 } |
846 } | 846 } |
847 return false; | 847 return false; |
848 } | 848 } |
849 | 849 |
850 } // namespace extensions | 850 } // namespace extensions |
OLD | NEW |