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 815 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
826 items_to_remove.insert(iter->first); | 826 items_to_remove.insert(iter->first); |
827 } | 827 } |
828 | 828 |
829 std::set<MenuItem::Id>::iterator remove_iter; | 829 std::set<MenuItem::Id>::iterator remove_iter; |
830 for (remove_iter = items_to_remove.begin(); | 830 for (remove_iter = items_to_remove.begin(); |
831 remove_iter != items_to_remove.end(); | 831 remove_iter != items_to_remove.end(); |
832 ++remove_iter) | 832 ++remove_iter) |
833 RemoveContextMenuItem(*remove_iter); | 833 RemoveContextMenuItem(*remove_iter); |
834 } | 834 } |
835 | 835 |
836 MenuItem::Id::Id() | 836 MenuItem::Id::Id() : incognito(false), uid(0) {} |
837 : incognito(false), extension_id(""), uid(0), string_uid("") { | |
838 } | |
839 | 837 |
840 MenuItem::Id::Id(bool incognito, const std::string& extension_id) | 838 MenuItem::Id::Id(bool incognito, const std::string& extension_id) |
841 : incognito(incognito), extension_id(extension_id), uid(0), | 839 : incognito(incognito), extension_id(extension_id), uid(0) {} |
842 string_uid("") { | |
843 } | |
844 | 840 |
845 MenuItem::Id::~Id() { | 841 MenuItem::Id::~Id() { |
846 } | 842 } |
847 | 843 |
848 bool MenuItem::Id::operator==(const Id& other) const { | 844 bool MenuItem::Id::operator==(const Id& other) const { |
849 return (incognito == other.incognito && | 845 return (incognito == other.incognito && |
850 extension_id == other.extension_id && | 846 extension_id == other.extension_id && |
851 uid == other.uid && | 847 uid == other.uid && |
852 string_uid == other.string_uid); | 848 string_uid == other.string_uid); |
853 } | 849 } |
(...skipping 12 matching lines...) Expand all Loading... |
866 if (uid < other.uid) | 862 if (uid < other.uid) |
867 return true; | 863 return true; |
868 if (uid == other.uid) | 864 if (uid == other.uid) |
869 return string_uid < other.string_uid; | 865 return string_uid < other.string_uid; |
870 } | 866 } |
871 } | 867 } |
872 return false; | 868 return false; |
873 } | 869 } |
874 | 870 |
875 } // namespace extensions | 871 } // namespace extensions |
OLD | NEW |