OLD | NEW |
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/extensions/extension_settings_handler.h" | 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h" |
6 | 6 |
7 #include "base/auto_reset.h" | 7 #include "base/auto_reset.h" |
8 #include "base/base64.h" | 8 #include "base/base64.h" |
9 #include "base/bind.h" | 9 #include "base/bind.h" |
10 #include "base/bind_helpers.h" | 10 #include "base/bind_helpers.h" |
(...skipping 114 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
125 extension->GetHomepageURL().is_valid()); | 125 extension->GetHomepageURL().is_valid()); |
126 | 126 |
127 // Determine the sort order: Extensions loaded through --load-extensions show | 127 // Determine the sort order: Extensions loaded through --load-extensions show |
128 // up at the top. Disabled extensions show up at the bottom. | 128 // up at the top. Disabled extensions show up at the bottom. |
129 if (extension->location() == Extension::LOAD) | 129 if (extension->location() == Extension::LOAD) |
130 extension_data->SetInteger("order", 1); | 130 extension_data->SetInteger("order", 1); |
131 else | 131 else |
132 extension_data->SetInteger("order", 2); | 132 extension_data->SetInteger("order", 2); |
133 | 133 |
134 if (extension_service_ && | 134 if (extension_service_ && |
135 !extension_service_->GetBrowserActionVisibility(extension)) { | 135 !extension_service_->extension_prefs()-> |
| 136 GetBrowserActionVisibility(extension)) { |
136 extension_data->SetBoolean("enable_show_button", true); | 137 extension_data->SetBoolean("enable_show_button", true); |
137 } | 138 } |
138 | 139 |
139 // Add views | 140 // Add views |
140 ListValue* views = new ListValue; | 141 ListValue* views = new ListValue; |
141 for (std::vector<ExtensionPage>::const_iterator iter = pages.begin(); | 142 for (std::vector<ExtensionPage>::const_iterator iter = pages.begin(); |
142 iter != pages.end(); ++iter) { | 143 iter != pages.end(); ++iter) { |
143 DictionaryValue* view_value = new DictionaryValue; | 144 DictionaryValue* view_value = new DictionaryValue; |
144 if (iter->url.scheme() == chrome::kExtensionScheme) { | 145 if (iter->url.scheme() == chrome::kExtensionScheme) { |
145 // No leading slash. | 146 // No leading slash. |
(...skipping 508 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
654 void ExtensionSettingsHandler::HandleOptionsMessage(const ListValue* args) { | 655 void ExtensionSettingsHandler::HandleOptionsMessage(const ListValue* args) { |
655 const Extension* extension = GetExtension(args); | 656 const Extension* extension = GetExtension(args); |
656 if (!extension || extension->options_url().is_empty()) | 657 if (!extension || extension->options_url().is_empty()) |
657 return; | 658 return; |
658 Profile::FromWebUI(web_ui())->GetExtensionProcessManager()->OpenOptionsPage( | 659 Profile::FromWebUI(web_ui())->GetExtensionProcessManager()->OpenOptionsPage( |
659 extension, NULL); | 660 extension, NULL); |
660 } | 661 } |
661 | 662 |
662 void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) { | 663 void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) { |
663 const Extension* extension = GetExtension(args); | 664 const Extension* extension = GetExtension(args); |
664 extension_service_->SetBrowserActionVisibility(extension, true); | 665 extension_service_->extension_prefs()-> |
| 666 SetBrowserActionVisibility(extension, true); |
665 } | 667 } |
666 | 668 |
667 void ExtensionSettingsHandler::HandleAutoUpdateMessage(const ListValue* args) { | 669 void ExtensionSettingsHandler::HandleAutoUpdateMessage(const ListValue* args) { |
668 ExtensionUpdater* updater = extension_service_->updater(); | 670 ExtensionUpdater* updater = extension_service_->updater(); |
669 if (updater) | 671 if (updater) |
670 updater->CheckNow(); | 672 updater->CheckNow(); |
671 } | 673 } |
672 | 674 |
673 void ExtensionSettingsHandler::HandleLoadUnpackedExtensionMessage( | 675 void ExtensionSettingsHandler::HandleLoadUnpackedExtensionMessage( |
674 const ListValue* args) { | 676 const ListValue* args) { |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
814 return extension_uninstall_dialog_.get(); | 816 return extension_uninstall_dialog_.get(); |
815 #else | 817 #else |
816 return NULL; | 818 return NULL; |
817 #endif // !defined(OS_ANDROID) | 819 #endif // !defined(OS_ANDROID) |
818 } | 820 } |
819 | 821 |
820 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { | 822 void ExtensionSettingsHandler::InspectExtensionHost(ExtensionHost* host) { |
821 if (host) | 823 if (host) |
822 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); | 824 DevToolsWindow::OpenDevToolsWindow(host->render_view_host()); |
823 } | 825 } |
OLD | NEW |