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 11 matching lines...) Expand all Loading... |
22 #include "content/public/common/context_menu_params.h" | 22 #include "content/public/common/context_menu_params.h" |
23 #include "ui/base/text/text_elider.h" | 23 #include "ui/base/text/text_elider.h" |
24 #include "ui/gfx/favicon_size.h" | 24 #include "ui/gfx/favicon_size.h" |
25 | 25 |
26 using content::WebContents; | 26 using content::WebContents; |
27 | 27 |
28 namespace { | 28 namespace { |
29 | 29 |
30 void SetIdKeyValue(base::DictionaryValue* properties, | 30 void SetIdKeyValue(base::DictionaryValue* properties, |
31 const char* key, | 31 const char* key, |
32 ExtensionMenuItem::Id id) { | 32 const ExtensionMenuItem::Id& id) { |
33 if (id.uid == 0) | 33 if (id.uid == 0) |
34 properties->SetString(key, id.string_uid); | 34 properties->SetString(key, id.string_uid); |
35 else | 35 else |
36 properties->SetInteger(key, id.uid); | 36 properties->SetInteger(key, id.uid); |
37 } | 37 } |
38 | 38 |
39 } // namespace | 39 } // namespace |
40 | 40 |
41 ExtensionMenuItem::ExtensionMenuItem(const Id& id, | 41 ExtensionMenuItem::ExtensionMenuItem(const Id& id, |
42 const std::string& title, | 42 const std::string& title, |
(...skipping 545 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
588 return true; | 588 return true; |
589 if (extension_id == other.extension_id) { | 589 if (extension_id == other.extension_id) { |
590 if (uid < other.uid) | 590 if (uid < other.uid) |
591 return true; | 591 return true; |
592 if (uid == other.uid) | 592 if (uid == other.uid) |
593 return string_uid < other.string_uid; | 593 return string_uid < other.string_uid; |
594 } | 594 } |
595 } | 595 } |
596 return false; | 596 return false; |
597 } | 597 } |
OLD | NEW |