Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(552)

Side by Side Diff: chrome/browser/renderer_context_menu/render_view_context_menu.cc

Issue 671763002: Extract ProcessManager from ExtensionSystem. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased. Created 6 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/renderer_context_menu/render_view_context_menu.h" 5 #include "chrome/browser/renderer_context_menu/render_view_context_menu.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <set> 8 #include <set>
9 #include <utility> 9 #include <utility>
10 10
(...skipping 609 matching lines...) Expand 10 before | Expand all | Expand 10 after
620 if (!print_preview_menu_observer_.get()) { 620 if (!print_preview_menu_observer_.get()) {
621 print_preview_menu_observer_.reset( 621 print_preview_menu_observer_.reset(
622 new PrintPreviewContextMenuObserver(source_web_contents_)); 622 new PrintPreviewContextMenuObserver(source_web_contents_));
623 } 623 }
624 624
625 observers_.AddObserver(print_preview_menu_observer_.get()); 625 observers_.AddObserver(print_preview_menu_observer_.get());
626 #endif 626 #endif
627 } 627 }
628 628
629 const Extension* RenderViewContextMenu::GetExtension() const { 629 const Extension* RenderViewContextMenu::GetExtension() const {
630 extensions::ExtensionSystem* system = 630 return extensions::ProcessManager::Get(browser_context_)
631 extensions::ExtensionSystem::Get(browser_context_); 631 ->GetExtensionForRenderViewHost(
632 // There is no process manager in some tests. 632 source_web_contents_->GetRenderViewHost());
633 if (!system->process_manager())
634 return NULL;
635
636 return system->process_manager()->GetExtensionForRenderViewHost(
637 source_web_contents_->GetRenderViewHost());
638 } 633 }
639 634
640 void RenderViewContextMenu::AppendDeveloperItems() { 635 void RenderViewContextMenu::AppendDeveloperItems() {
641 // Show Inspect Element in DevTools itself only in case of the debug 636 // Show Inspect Element in DevTools itself only in case of the debug
642 // devtools build. 637 // devtools build.
643 bool show_developer_items = !IsDevToolsURL(params_.page_url); 638 bool show_developer_items = !IsDevToolsURL(params_.page_url);
644 639
645 #if defined(DEBUG_DEVTOOLS) 640 #if defined(DEBUG_DEVTOOLS)
646 show_developer_items = true; 641 show_developer_items = true;
647 #endif 642 #endif
(...skipping 1144 matching lines...) Expand 10 before | Expand all | Expand 10 after
1792 source_web_contents_->GetRenderViewHost()-> 1787 source_web_contents_->GetRenderViewHost()->
1793 ExecuteMediaPlayerActionAtLocation(location, action); 1788 ExecuteMediaPlayerActionAtLocation(location, action);
1794 } 1789 }
1795 1790
1796 void RenderViewContextMenu::PluginActionAt( 1791 void RenderViewContextMenu::PluginActionAt(
1797 const gfx::Point& location, 1792 const gfx::Point& location,
1798 const WebPluginAction& action) { 1793 const WebPluginAction& action) {
1799 source_web_contents_->GetRenderViewHost()-> 1794 source_web_contents_->GetRenderViewHost()->
1800 ExecutePluginActionAtLocation(location, action); 1795 ExecutePluginActionAtLocation(location, action);
1801 } 1796 }
OLDNEW
« no previous file with comments | « chrome/browser/policy/policy_browsertest.cc ('k') | chrome/browser/speech/extension_api/tts_engine_extension_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698