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

Side by Side Diff: chrome/browser/ui/webui/extensions/extension_settings_handler.cc

Issue 11434074: browser: Move FindBrowserWithWebContents() into chrome namespace. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 8 years 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/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 735 matching lines...) Expand 10 before | Expand all | Expand 10 after
746 746
747 GetExtensionUninstallDialog()->ConfirmUninstall(extension); 747 GetExtensionUninstallDialog()->ConfirmUninstall(extension);
748 } 748 }
749 749
750 void ExtensionSettingsHandler::HandleOptionsMessage(const ListValue* args) { 750 void ExtensionSettingsHandler::HandleOptionsMessage(const ListValue* args) {
751 const Extension* extension = GetActiveExtension(args); 751 const Extension* extension = GetActiveExtension(args);
752 if (!extension || extension->options_url().is_empty()) 752 if (!extension || extension->options_url().is_empty())
753 return; 753 return;
754 extensions::ExtensionSystem::Get(Profile::FromWebUI(web_ui()))-> 754 extensions::ExtensionSystem::Get(Profile::FromWebUI(web_ui()))->
755 process_manager()->OpenOptionsPage(extension, 755 process_manager()->OpenOptionsPage(extension,
756 browser::FindBrowserWithWebContents(web_ui()->GetWebContents())); 756 chrome::FindBrowserWithWebContents(web_ui()->GetWebContents()));
757 } 757 }
758 758
759 void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) { 759 void ExtensionSettingsHandler::HandleShowButtonMessage(const ListValue* args) {
760 const Extension* extension = GetActiveExtension(args); 760 const Extension* extension = GetActiveExtension(args);
761 if (!extension) 761 if (!extension)
762 return; 762 return;
763 extension_service_->extension_prefs()-> 763 extension_service_->extension_prefs()->
764 SetBrowserActionVisibility(extension, true); 764 SetBrowserActionVisibility(extension, true);
765 } 765 }
766 766
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
945 ExtensionPage(web_contents->GetURL(), process->GetID(), 945 ExtensionPage(web_contents->GetURL(), process->GetID(),
946 host->GetRoutingID(), 946 host->GetRoutingID(),
947 process->GetBrowserContext()->IsOffTheRecord())); 947 process->GetBrowserContext()->IsOffTheRecord()));
948 } 948 }
949 } 949 }
950 950
951 ExtensionUninstallDialog* 951 ExtensionUninstallDialog*
952 ExtensionSettingsHandler::GetExtensionUninstallDialog() { 952 ExtensionSettingsHandler::GetExtensionUninstallDialog() {
953 #if !defined(OS_ANDROID) 953 #if !defined(OS_ANDROID)
954 if (!extension_uninstall_dialog_.get()) { 954 if (!extension_uninstall_dialog_.get()) {
955 Browser* browser = browser::FindBrowserWithWebContents( 955 Browser* browser = chrome::FindBrowserWithWebContents(
956 web_ui()->GetWebContents()); 956 web_ui()->GetWebContents());
957 extension_uninstall_dialog_.reset( 957 extension_uninstall_dialog_.reset(
958 ExtensionUninstallDialog::Create(browser, this)); 958 ExtensionUninstallDialog::Create(browser, this));
959 } 959 }
960 return extension_uninstall_dialog_.get(); 960 return extension_uninstall_dialog_.get();
961 #else 961 #else
962 return NULL; 962 return NULL;
963 #endif // !defined(OS_ANDROID) 963 #endif // !defined(OS_ANDROID)
964 } 964 }
965 965
966 void ExtensionSettingsHandler::OnRequirementsChecked( 966 void ExtensionSettingsHandler::OnRequirementsChecked(
967 std::string extension_id, 967 std::string extension_id,
968 std::vector<std::string> requirement_errors) { 968 std::vector<std::string> requirement_errors) {
969 if (requirement_errors.empty()) { 969 if (requirement_errors.empty()) {
970 extension_service_->EnableExtension(extension_id); 970 extension_service_->EnableExtension(extension_id);
971 } else { 971 } else {
972 ExtensionErrorReporter::GetInstance()->ReportError( 972 ExtensionErrorReporter::GetInstance()->ReportError(
973 UTF8ToUTF16(JoinString(requirement_errors, ' ')), 973 UTF8ToUTF16(JoinString(requirement_errors, ' ')),
974 true /* be noisy */); 974 true /* be noisy */);
975 } 975 }
976 requirements_checker_.reset(); 976 requirements_checker_.reset();
977 } 977 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/webui/chrome_web_contents_handler.cc ('k') | chrome/browser/ui/webui/help/help_handler.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698