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

Side by Side Diff: chrome/browser/extensions/extension_context_menu_model.cc

Issue 2365263006: Delete pre-MD code from OmniboxResultView (Closed)
Patch Set: update references to constant (merge resolution) Created 4 years, 2 months 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 (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/extension_context_menu_model.h" 5 #include "chrome/browser/extensions/extension_context_menu_model.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/strings/utf_string_conversions.h" 8 #include "base/strings/utf_string_conversions.h"
9 #include "chrome/app/chrome_command_ids.h" 9 #include "chrome/app/chrome_command_ids.h"
10 #include "chrome/browser/extensions/context_menu_matcher.h" 10 #include "chrome/browser/extensions/context_menu_matcher.h"
(...skipping 25 matching lines...) Expand all
36 #include "extensions/browser/extension_registry.h" 36 #include "extensions/browser/extension_registry.h"
37 #include "extensions/browser/extension_system.h" 37 #include "extensions/browser/extension_system.h"
38 #include "extensions/browser/management_policy.h" 38 #include "extensions/browser/management_policy.h"
39 #include "extensions/browser/uninstall_reason.h" 39 #include "extensions/browser/uninstall_reason.h"
40 #include "extensions/common/extension.h" 40 #include "extensions/common/extension.h"
41 #include "extensions/common/feature_switch.h" 41 #include "extensions/common/feature_switch.h"
42 #include "extensions/common/manifest_handlers/options_page_info.h" 42 #include "extensions/common/manifest_handlers/options_page_info.h"
43 #include "extensions/common/manifest_url_handlers.h" 43 #include "extensions/common/manifest_url_handlers.h"
44 #include "ui/base/l10n/l10n_util.h" 44 #include "ui/base/l10n/l10n_util.h"
45 #include "ui/base/resource/resource_bundle.h" 45 #include "ui/base/resource/resource_bundle.h"
46 #include "ui/gfx/color_palette.h"
46 #include "ui/gfx/image/image.h" 47 #include "ui/gfx/image/image.h"
48 #include "ui/gfx/paint_vector_icon.h"
49 #include "ui/gfx/vector_icons_public.h"
47 50
48 namespace extensions { 51 namespace extensions {
49 52
50 namespace { 53 namespace {
51 54
52 // Returns true if the given |item| is of the given |type|. 55 // Returns true if the given |item| is of the given |type|.
53 bool MenuItemMatchesAction(ExtensionContextMenuModel::ActionType type, 56 bool MenuItemMatchesAction(ExtensionContextMenuModel::ActionType type,
54 const MenuItem* item) { 57 const MenuItem* item) {
55 if (type == ExtensionContextMenuModel::NO_ACTION) 58 if (type == ExtensionContextMenuModel::NO_ACTION)
56 return false; 59 return false;
(...skipping 263 matching lines...) Expand 10 before | Expand all | Expand 10 after
320 323
321 if (!is_component_) { 324 if (!is_component_) {
322 bool is_required_by_policy = 325 bool is_required_by_policy =
323 IsExtensionRequiredByPolicy(extension, profile_); 326 IsExtensionRequiredByPolicy(extension, profile_);
324 int message_id = is_required_by_policy ? 327 int message_id = is_required_by_policy ?
325 IDS_EXTENSIONS_INSTALLED_BY_ADMIN : IDS_EXTENSIONS_UNINSTALL; 328 IDS_EXTENSIONS_INSTALLED_BY_ADMIN : IDS_EXTENSIONS_UNINSTALL;
326 AddItem(UNINSTALL, l10n_util::GetStringUTF16(message_id)); 329 AddItem(UNINSTALL, l10n_util::GetStringUTF16(message_id));
327 if (is_required_by_policy) { 330 if (is_required_by_policy) {
328 int uninstall_index = GetIndexOfCommandId(UNINSTALL); 331 int uninstall_index = GetIndexOfCommandId(UNINSTALL);
329 SetIcon(uninstall_index, 332 SetIcon(uninstall_index,
330 ui::ResourceBundle::GetSharedInstance().GetImageNamed( 333 gfx::Image(gfx::CreateVectorIcon(gfx::VectorIconId::BUSINESS, 16,
sky 2016/10/06 21:18:55 Business, eh? I'm assuming this is right.
Evan Stade 2016/10/06 21:27:10 yea, it looks like a small cluster of office build
331 IDR_OMNIBOX_HTTPS_POLICY_WARNING)); 334 gfx::kChromeIconGrey)));
332 } 335 }
333 } 336 }
334 337
335 // Add a toggle visibility (show/hide) if the extension icon is shown on the 338 // Add a toggle visibility (show/hide) if the extension icon is shown on the
336 // toolbar. 339 // toolbar.
337 int visibility_string_id = 340 int visibility_string_id =
338 GetVisibilityStringId(profile_, extension, button_visibility); 341 GetVisibilityStringId(profile_, extension, button_visibility);
339 if (visibility_string_id != -1) 342 if (visibility_string_id != -1)
340 AddItemWithStringId(TOGGLE_VISIBILITY, visibility_string_id); 343 AddItemWithStringId(TOGGLE_VISIBILITY, visibility_string_id);
341 344
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
457 if (runner && runner->WantsToRun(extension)) 460 if (runner && runner->WantsToRun(extension))
458 runner->RunBlockedActions(extension); 461 runner->RunBlockedActions(extension);
459 } 462 }
460 } 463 }
461 464
462 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const { 465 content::WebContents* ExtensionContextMenuModel::GetActiveWebContents() const {
463 return browser_->tab_strip_model()->GetActiveWebContents(); 466 return browser_->tab_strip_model()->GetActiveWebContents();
464 } 467 }
465 468
466 } // namespace extensions 469 } // namespace extensions
OLDNEW
« no previous file with comments | « chrome/browser/chromeos/options/network_config_view.cc ('k') | chrome/browser/ui/app_list/search/omnibox_result.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698