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 "base/utf_string_conversions.h" | 5 #include "base/utf_string_conversions.h" |
6 #include "chrome/app/chrome_command_ids.h" | 6 #include "chrome/app/chrome_command_ids.h" |
7 #include "chrome/browser/extensions/context_menu_matcher.h" | 7 #include "chrome/browser/extensions/context_menu_matcher.h" |
8 #include "chrome/browser/extensions/extension_service.h" | 8 #include "chrome/browser/extensions/extension_service.h" |
9 #include "chrome/browser/extensions/extension_system.h" | 9 #include "chrome/browser/extensions/extension_system.h" |
10 #include "chrome/browser/profiles/profile.h" | 10 #include "chrome/browser/profiles/profile.h" |
11 #include "content/public/common/context_menu_params.h" | 11 #include "content/public/common/context_menu_params.h" |
12 #include "ui/gfx/favicon_size.h" | 12 #include "ui/gfx/favicon_size.h" |
| 13 #include "ui/gfx/image/image.h" |
13 | 14 |
14 namespace extensions { | 15 namespace extensions { |
15 | 16 |
16 // static | 17 // static |
17 const size_t ContextMenuMatcher::kMaxExtensionItemTitleLength = 75; | 18 const size_t ContextMenuMatcher::kMaxExtensionItemTitleLength = 75; |
18 | 19 |
19 ContextMenuMatcher::ContextMenuMatcher( | 20 ContextMenuMatcher::ContextMenuMatcher( |
20 Profile* profile, | 21 Profile* profile, |
21 ui::SimpleMenuModel::Delegate* delegate, | 22 ui::SimpleMenuModel::Delegate* delegate, |
22 ui::SimpleMenuModel* menu_model, | 23 ui::SimpleMenuModel* menu_model, |
(...skipping 200 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
223 DCHECK_GE(index, 0); | 224 DCHECK_GE(index, 0); |
224 | 225 |
225 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id); | 226 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id); |
226 DCHECK(icon.width() == gfx::kFaviconSize); | 227 DCHECK(icon.width() == gfx::kFaviconSize); |
227 DCHECK(icon.height() == gfx::kFaviconSize); | 228 DCHECK(icon.height() == gfx::kFaviconSize); |
228 | 229 |
229 menu_model_->SetIcon(index, gfx::Image::CreateFrom1xBitmap(icon)); | 230 menu_model_->SetIcon(index, gfx::Image::CreateFrom1xBitmap(icon)); |
230 } | 231 } |
231 | 232 |
232 } // namespace extensions | 233 } // namespace extensions |
OLD | NEW |