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

Side by Side Diff: chrome/browser/ui/views/location_bar/origin_chip_view.cc

Issue 709813004: Remove the deprecated function ExtensionService::extensions(). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addressed thestig@'s comments. 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/ui/views/location_bar/origin_chip_view.h" 5 #include "chrome/browser/ui/views/location_bar/origin_chip_view.h"
6 6
7 #include "base/files/file_path.h" 7 #include "base/files/file_path.h"
8 #include "base/metrics/histogram.h" 8 #include "base/metrics/histogram.h"
9 #include "base/strings/string_util.h" 9 #include "base/strings/string_util.h"
10 #include "base/strings/utf_string_conversions.h" 10 #include "base/strings/utf_string_conversions.h"
11 #include "chrome/browser/browser_process.h" 11 #include "chrome/browser/browser_process.h"
12 #include "chrome/browser/extensions/extension_service.h"
13 #include "chrome/browser/extensions/extension_util.h" 12 #include "chrome/browser/extensions/extension_util.h"
14 #include "chrome/browser/favicon/favicon_tab_helper.h" 13 #include "chrome/browser/favicon/favicon_tab_helper.h"
15 #include "chrome/browser/profiles/profile.h" 14 #include "chrome/browser/profiles/profile.h"
16 #include "chrome/browser/safe_browsing/safe_browsing_service.h" 15 #include "chrome/browser/safe_browsing/safe_browsing_service.h"
17 #include "chrome/browser/safe_browsing/ui_manager.h" 16 #include "chrome/browser/safe_browsing/ui_manager.h"
18 #include "chrome/browser/search/search.h" 17 #include "chrome/browser/search/search.h"
19 #include "chrome/browser/themes/theme_properties.h" 18 #include "chrome/browser/themes/theme_properties.h"
20 #include "chrome/browser/ui/browser.h" 19 #include "chrome/browser/ui/browser.h"
21 #include "chrome/browser/ui/elide_url.h" 20 #include "chrome/browser/ui/elide_url.h"
22 #include "chrome/browser/ui/location_bar/origin_chip_info.h" 21 #include "chrome/browser/ui/location_bar/origin_chip_info.h"
23 #include "chrome/browser/ui/omnibox/omnibox_view.h" 22 #include "chrome/browser/ui/omnibox/omnibox_view.h"
24 #include "chrome/browser/ui/toolbar/toolbar_model.h" 23 #include "chrome/browser/ui/toolbar/toolbar_model.h"
25 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 24 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
26 #include "chrome/common/extensions/extension_constants.h" 25 #include "chrome/common/extensions/extension_constants.h"
27 #include "content/public/browser/user_metrics.h" 26 #include "content/public/browser/user_metrics.h"
28 #include "content/public/browser/web_contents.h" 27 #include "content/public/browser/web_contents.h"
29 #include "content/public/common/url_constants.h" 28 #include "content/public/common/url_constants.h"
30 #include "extensions/browser/extension_icon_image.h" 29 #include "extensions/browser/extension_icon_image.h"
31 #include "extensions/browser/extension_system.h" 30 #include "extensions/browser/extension_registry.h"
32 #include "extensions/common/constants.h" 31 #include "extensions/common/constants.h"
33 #include "extensions/common/manifest_handlers/icons_handler.h" 32 #include "extensions/common/manifest_handlers/icons_handler.h"
34 #include "grit/theme_resources.h" 33 #include "grit/theme_resources.h"
35 #include "ui/base/resource/resource_bundle.h" 34 #include "ui/base/resource/resource_bundle.h"
36 #include "ui/base/theme_provider.h" 35 #include "ui/base/theme_provider.h"
37 #include "ui/gfx/canvas.h" 36 #include "ui/gfx/canvas.h"
38 #include "ui/gfx/font_list.h" 37 #include "ui/gfx/font_list.h"
39 #include "ui/gfx/text_utils.h" 38 #include "ui/gfx/text_utils.h"
40 #include "ui/views/background.h" 39 #include "ui/views/background.h"
41 #include "ui/views/controls/button/label_button.h" 40 #include "ui/views/controls/button/label_button.h"
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
120 119
121 const int kEVImages[3][9] = { 120 const int kEVImages[3][9] = {
122 IMAGE_GRID(IDR_ORIGIN_CHIP_EV_NORMAL), 121 IMAGE_GRID(IDR_ORIGIN_CHIP_EV_NORMAL),
123 IMAGE_GRID(IDR_ORIGIN_CHIP_EV_HOVER), 122 IMAGE_GRID(IDR_ORIGIN_CHIP_EV_HOVER),
124 IMAGE_GRID(IDR_ORIGIN_CHIP_EV_PRESSED) 123 IMAGE_GRID(IDR_ORIGIN_CHIP_EV_PRESSED)
125 }; 124 };
126 125
127 const extensions::Extension* GetExtension(const GURL& url, Profile* profile) { 126 const extensions::Extension* GetExtension(const GURL& url, Profile* profile) {
128 if (!url.SchemeIs(extensions::kExtensionScheme)) 127 if (!url.SchemeIs(extensions::kExtensionScheme))
129 return NULL; 128 return NULL;
130 ExtensionService* service = 129 extensions::ExtensionRegistry* registry =
131 extensions::ExtensionSystem::Get(profile)->extension_service(); 130 extensions::ExtensionRegistry::Get(profile);
132 return service->extensions()->GetExtensionOrAppByURL(url); 131 return registry->enabled_extensions().GetByID(url.host());
133 } 132 }
134 133
135 } // namespace 134 } // namespace
136 135
137 OriginChipView::OriginChipView(LocationBarView* location_bar_view, 136 OriginChipView::OriginChipView(LocationBarView* location_bar_view,
138 Profile* profile, 137 Profile* profile,
139 const gfx::FontList& font_list) 138 const gfx::FontList& font_list)
140 : LabelButton(this, base::string16()), 139 : LabelButton(this, base::string16()),
141 location_bar_view_(location_bar_view), 140 location_bar_view_(location_bar_view),
142 profile_(profile), 141 profile_(profile),
(...skipping 264 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 406
408 // Note: When OnSafeBrowsingHit would be called, OnSafeBrowsingMatch will 407 // Note: When OnSafeBrowsingHit would be called, OnSafeBrowsingMatch will
409 // have already been called. 408 // have already been called.
410 void OriginChipView::OnSafeBrowsingHit( 409 void OriginChipView::OnSafeBrowsingHit(
411 const SafeBrowsingUIManager::UnsafeResource& resource) {} 410 const SafeBrowsingUIManager::UnsafeResource& resource) {}
412 411
413 void OriginChipView::OnSafeBrowsingMatch( 412 void OriginChipView::OnSafeBrowsingMatch(
414 const SafeBrowsingUIManager::UnsafeResource& resource) { 413 const SafeBrowsingUIManager::UnsafeResource& resource) {
415 OnChanged(); 414 OnChanged();
416 } 415 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/sync/profile_signin_confirmation_helper.cc ('k') | chrome/browser/ui/webui/extensions/extension_info_ui.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698