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 599 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
610 RadioItemSelected(item); | 610 RadioItemSelected(item); |
611 | 611 |
612 scoped_ptr<base::ListValue> args(new base::ListValue()); | 612 scoped_ptr<base::ListValue> args(new base::ListValue()); |
613 | 613 |
614 DictionaryValue* properties = new DictionaryValue(); | 614 DictionaryValue* properties = new DictionaryValue(); |
615 SetIdKeyValue(properties, "menuItemId", item->id()); | 615 SetIdKeyValue(properties, "menuItemId", item->id()); |
616 if (item->parent_id()) | 616 if (item->parent_id()) |
617 SetIdKeyValue(properties, "parentMenuItemId", *item->parent_id()); | 617 SetIdKeyValue(properties, "parentMenuItemId", *item->parent_id()); |
618 | 618 |
619 switch (params.media_type) { | 619 switch (params.media_type) { |
620 case WebKit::WebContextMenuData::MediaTypeImage: | 620 case blink::WebContextMenuData::MediaTypeImage: |
621 properties->SetString("mediaType", "image"); | 621 properties->SetString("mediaType", "image"); |
622 break; | 622 break; |
623 case WebKit::WebContextMenuData::MediaTypeVideo: | 623 case blink::WebContextMenuData::MediaTypeVideo: |
624 properties->SetString("mediaType", "video"); | 624 properties->SetString("mediaType", "video"); |
625 break; | 625 break; |
626 case WebKit::WebContextMenuData::MediaTypeAudio: | 626 case blink::WebContextMenuData::MediaTypeAudio: |
627 properties->SetString("mediaType", "audio"); | 627 properties->SetString("mediaType", "audio"); |
628 break; | 628 break; |
629 default: {} // Do nothing. | 629 default: {} // Do nothing. |
630 } | 630 } |
631 | 631 |
632 AddURLProperty(properties, "linkUrl", params.unfiltered_link_url); | 632 AddURLProperty(properties, "linkUrl", params.unfiltered_link_url); |
633 AddURLProperty(properties, "srcUrl", params.src_url); | 633 AddURLProperty(properties, "srcUrl", params.src_url); |
634 AddURLProperty(properties, "pageUrl", params.page_url); | 634 AddURLProperty(properties, "pageUrl", params.page_url); |
635 AddURLProperty(properties, "frameUrl", params.frame_url); | 635 AddURLProperty(properties, "frameUrl", params.frame_url); |
636 | 636 |
(...skipping 227 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
864 if (uid < other.uid) | 864 if (uid < other.uid) |
865 return true; | 865 return true; |
866 if (uid == other.uid) | 866 if (uid == other.uid) |
867 return string_uid < other.string_uid; | 867 return string_uid < other.string_uid; |
868 } | 868 } |
869 } | 869 } |
870 return false; | 870 return false; |
871 } | 871 } |
872 | 872 |
873 } // namespace extensions | 873 } // namespace extensions |
OLD | NEW |