| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 <algorithm> | 5 #include <algorithm> |
| 6 #include <set> | 6 #include <set> |
| 7 | 7 |
| 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" | 8 #include "chrome/browser/tab_contents/render_view_context_menu.h" |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 383 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 } | 394 } |
| 395 | 395 |
| 396 void RenderViewContextMenu::SetExtensionIcon(const std::string& extension_id) { | 396 void RenderViewContextMenu::SetExtensionIcon(const std::string& extension_id) { |
| 397 ExtensionService* service = profile_->GetExtensionService(); | 397 ExtensionService* service = profile_->GetExtensionService(); |
| 398 ExtensionMenuManager* menu_manager = service->menu_manager(); | 398 ExtensionMenuManager* menu_manager = service->menu_manager(); |
| 399 | 399 |
| 400 int index = menu_model_.GetItemCount() - 1; | 400 int index = menu_model_.GetItemCount() - 1; |
| 401 DCHECK_GE(index, 0); | 401 DCHECK_GE(index, 0); |
| 402 | 402 |
| 403 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id); | 403 const SkBitmap& icon = menu_manager->GetIconForExtension(extension_id); |
| 404 DCHECK(icon.width() == kFavIconSize); | 404 DCHECK(icon.width() == kFaviconSize); |
| 405 DCHECK(icon.height() == kFavIconSize); | 405 DCHECK(icon.height() == kFaviconSize); |
| 406 | 406 |
| 407 menu_model_.SetIcon(index, icon); | 407 menu_model_.SetIcon(index, icon); |
| 408 } | 408 } |
| 409 | 409 |
| 410 void RenderViewContextMenu::AppendAllExtensionItems() { | 410 void RenderViewContextMenu::AppendAllExtensionItems() { |
| 411 extension_item_map_.clear(); | 411 extension_item_map_.clear(); |
| 412 ExtensionService* service = profile_->GetExtensionService(); | 412 ExtensionService* service = profile_->GetExtensionService(); |
| 413 if (!service) | 413 if (!service) |
| 414 return; // In unit-tests, we may not have an ExtensionService. | 414 return; // In unit-tests, we may not have an ExtensionService. |
| 415 ExtensionMenuManager* menu_manager = service->menu_manager(); | 415 ExtensionMenuManager* menu_manager = service->menu_manager(); |
| (...skipping 1111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1527 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), | 1527 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), |
| 1528 g_browser_process->clipboard()); | 1528 g_browser_process->clipboard()); |
| 1529 } | 1529 } |
| 1530 | 1530 |
| 1531 void RenderViewContextMenu::MediaPlayerActionAt( | 1531 void RenderViewContextMenu::MediaPlayerActionAt( |
| 1532 const gfx::Point& location, | 1532 const gfx::Point& location, |
| 1533 const WebMediaPlayerAction& action) { | 1533 const WebMediaPlayerAction& action) { |
| 1534 source_tab_contents_->render_view_host()->MediaPlayerActionAt( | 1534 source_tab_contents_->render_view_host()->MediaPlayerActionAt( |
| 1535 location, action); | 1535 location, action); |
| 1536 } | 1536 } |
| OLD | NEW |