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

Side by Side Diff: chrome/browser/ui/webui/ntp/app_launcher_handler.cc

Issue 16248002: Move Extension::GetBasicInfo to a static helper. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 7 years, 6 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 | Annotate | Revision Log
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/ui/webui/ntp/app_launcher_handler.h" 5 #include "chrome/browser/ui/webui/ntp/app_launcher_handler.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "apps/pref_names.h" 9 #include "apps/pref_names.h"
10 #include "base/auto_reset.h" 10 #include "base/auto_reset.h"
(...skipping 15 matching lines...) Expand all
26 #include "chrome/browser/favicon/favicon_service_factory.h" 26 #include "chrome/browser/favicon/favicon_service_factory.h"
27 #include "chrome/browser/favicon/favicon_types.h" 27 #include "chrome/browser/favicon/favicon_types.h"
28 #include "chrome/browser/prefs/scoped_user_pref_update.h" 28 #include "chrome/browser/prefs/scoped_user_pref_update.h"
29 #include "chrome/browser/profiles/profile.h" 29 #include "chrome/browser/profiles/profile.h"
30 #include "chrome/browser/ui/browser_finder.h" 30 #include "chrome/browser/ui/browser_finder.h"
31 #include "chrome/browser/ui/browser_tabstrip.h" 31 #include "chrome/browser/ui/browser_tabstrip.h"
32 #include "chrome/browser/ui/browser_window.h" 32 #include "chrome/browser/ui/browser_window.h"
33 #include "chrome/browser/ui/extensions/application_launch.h" 33 #include "chrome/browser/ui/extensions/application_launch.h"
34 #include "chrome/browser/ui/extensions/extension_enable_flow.h" 34 #include "chrome/browser/ui/extensions/extension_enable_flow.h"
35 #include "chrome/browser/ui/tabs/tab_strip_model.h" 35 #include "chrome/browser/ui/tabs/tab_strip_model.h"
36 #include "chrome/browser/ui/webui/extensions/extension_basic_info.h"
36 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h" 37 #include "chrome/browser/ui/webui/extensions/extension_icon_source.h"
37 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h" 38 #include "chrome/browser/ui/webui/ntp/new_tab_ui.h"
38 #include "chrome/common/chrome_notification_types.h" 39 #include "chrome/common/chrome_notification_types.h"
39 #include "chrome/common/extensions/extension.h" 40 #include "chrome/common/extensions/extension.h"
40 #include "chrome/common/extensions/extension_constants.h" 41 #include "chrome/common/extensions/extension_constants.h"
41 #include "chrome/common/extensions/extension_icon_set.h" 42 #include "chrome/common/extensions/extension_icon_set.h"
42 #include "chrome/common/pref_names.h" 43 #include "chrome/common/pref_names.h"
43 #include "chrome/common/url_constants.h" 44 #include "chrome/common/url_constants.h"
44 #include "chrome/common/web_application_info.h" 45 #include "chrome/common/web_application_info.h"
45 #include "components/user_prefs/pref_registry_syncable.h" 46 #include "components/user_prefs/pref_registry_syncable.h"
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after
96 value->Clear(); 97 value->Clear();
97 98
98 // The Extension class 'helpfully' wraps bidi control characters that 99 // The Extension class 'helpfully' wraps bidi control characters that
99 // impede our ability to determine directionality. 100 // impede our ability to determine directionality.
100 string16 name = UTF8ToUTF16(extension->name()); 101 string16 name = UTF8ToUTF16(extension->name());
101 base::i18n::UnadjustStringForLocaleDirection(&name); 102 base::i18n::UnadjustStringForLocaleDirection(&name);
102 NewTabUI::SetUrlTitleAndDirection(value, name, extension->GetFullLaunchURL()); 103 NewTabUI::SetUrlTitleAndDirection(value, name, extension->GetFullLaunchURL());
103 104
104 bool enabled = service->IsExtensionEnabled(extension->id()) && 105 bool enabled = service->IsExtensionEnabled(extension->id()) &&
105 !service->GetTerminatedExtension(extension->id()); 106 !service->GetTerminatedExtension(extension->id());
106 extension->GetBasicInfo(enabled, value); 107 extensions::GetExtensionBasicInfo(extension, enabled, value);
107 108
108 value->SetBoolean("mayDisable", extensions::ExtensionSystem::Get( 109 value->SetBoolean("mayDisable", extensions::ExtensionSystem::Get(
109 service->profile())->management_policy()->UserMayModifySettings( 110 service->profile())->management_policy()->UserMayModifySettings(
110 extension, NULL)); 111 extension, NULL));
111 112
112 bool icon_big_exists = true; 113 bool icon_big_exists = true;
113 // Instead of setting grayscale here, we do it in apps_page.js. 114 // Instead of setting grayscale here, we do it in apps_page.js.
114 GURL icon_big = 115 GURL icon_big =
115 ExtensionIconSource::GetIconURL(extension, 116 ExtensionIconSource::GetIconURL(extension,
116 extension_misc::EXTENSION_ICON_LARGE, 117 extension_misc::EXTENSION_ICON_LARGE,
(...skipping 752 matching lines...) Expand 10 before | Expand all | Expand 10 after
869 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() { 870 ExtensionUninstallDialog* AppLauncherHandler::GetExtensionUninstallDialog() {
870 if (!extension_uninstall_dialog_.get()) { 871 if (!extension_uninstall_dialog_.get()) {
871 Browser* browser = chrome::FindBrowserWithWebContents( 872 Browser* browser = chrome::FindBrowserWithWebContents(
872 web_ui()->GetWebContents()); 873 web_ui()->GetWebContents());
873 extension_uninstall_dialog_.reset( 874 extension_uninstall_dialog_.reset(
874 ExtensionUninstallDialog::Create(extension_service_->profile(), 875 ExtensionUninstallDialog::Create(extension_service_->profile(),
875 browser, this)); 876 browser, this));
876 } 877 }
877 return extension_uninstall_dialog_.get(); 878 return extension_uninstall_dialog_.get();
878 } 879 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/net_internals/net_internals_ui.cc ('k') | chrome/chrome_browser_ui.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698