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

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

Issue 4234004: Fix some UI issues with omnibox extensions in incognito. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: nits Created 10 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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 "app/l10n_util.h" 10 #include "app/l10n_util.h"
(...skipping 167 matching lines...) Expand 10 before | Expand all | Expand 10 after
178 result.push_back(*i); 178 result.push_back(*i);
179 } 179 }
180 return result; 180 return result;
181 } 181 }
182 182
183 void RenderViewContextMenu::AppendExtensionItems( 183 void RenderViewContextMenu::AppendExtensionItems(
184 const std::string& extension_id, int* index) { 184 const std::string& extension_id, int* index) {
185 ExtensionsService* service = profile_->GetExtensionsService(); 185 ExtensionsService* service = profile_->GetExtensionsService();
186 ExtensionMenuManager* manager = service->menu_manager(); 186 ExtensionMenuManager* manager = service->menu_manager();
187 const Extension* extension = service->GetExtensionById(extension_id, false); 187 const Extension* extension = service->GetExtensionById(extension_id, false);
188 bool can_cross_incognito = 188 bool can_cross_incognito = service->CanCrossIncognito(extension);
189 ExtensionEventRouter::CanCrossIncognito(profile_, extension);
190 DCHECK_GE(*index, 0); 189 DCHECK_GE(*index, 0);
191 int max_index = 190 int max_index =
192 IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST - IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST; 191 IDC_EXTENSIONS_CONTEXT_CUSTOM_LAST - IDC_EXTENSIONS_CONTEXT_CUSTOM_FIRST;
193 if (!extension || *index >= max_index) 192 if (!extension || *index >= max_index)
194 return; 193 return;
195 194
196 // Find matching items. 195 // Find matching items.
197 const ExtensionMenuItem::List* all_items = manager->MenuItems(extension_id); 196 const ExtensionMenuItem::List* all_items = manager->MenuItems(extension_id);
198 if (!all_items || all_items->empty()) 197 if (!all_items || all_items->empty())
199 return; 198 return;
(...skipping 1287 matching lines...) Expand 10 before | Expand all | Expand 10 after
1487 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages), 1486 profile_->GetPrefs()->GetString(prefs::kAcceptLanguages),
1488 g_browser_process->clipboard()); 1487 g_browser_process->clipboard());
1489 } 1488 }
1490 1489
1491 void RenderViewContextMenu::MediaPlayerActionAt( 1490 void RenderViewContextMenu::MediaPlayerActionAt(
1492 const gfx::Point& location, 1491 const gfx::Point& location,
1493 const WebMediaPlayerAction& action) { 1492 const WebMediaPlayerAction& action) {
1494 source_tab_contents_->render_view_host()->MediaPlayerActionAt( 1493 source_tab_contents_->render_view_host()->MediaPlayerActionAt(
1495 location, action); 1494 location, action);
1496 } 1495 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extensions_service.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698