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

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

Issue 887803003: extensions: clean up hiding/showing of developer controls. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: merge Created 5 years, 10 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/ui/webui/extensions/extension_settings_handler.h" 5 #include "chrome/browser/ui/webui/extensions/extension_settings_handler.h"
6 6
7 #include "apps/app_load_service.h" 7 #include "apps/app_load_service.h"
8 #include "apps/saved_files_service.h" 8 #include "apps/saved_files_service.h"
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/base64.h" 10 #include "base/base64.h"
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after
983 ->VerifyAllExtensions(); 983 ->VerifyAllExtensions();
984 } 984 }
985 } 985 }
986 986
987 void ExtensionSettingsHandler::HandleToggleDeveloperMode( 987 void ExtensionSettingsHandler::HandleToggleDeveloperMode(
988 const base::ListValue* args) { 988 const base::ListValue* args) {
989 Profile* profile = Profile::FromWebUI(web_ui()); 989 Profile* profile = Profile::FromWebUI(web_ui());
990 if (profile->IsSupervised()) 990 if (profile->IsSupervised())
991 return; 991 return;
992 992
993 bool developer_mode = 993 bool developer_mode_on;
994 !profile->GetPrefs()->GetBoolean(prefs::kExtensionsUIDeveloperMode); 994 CHECK(args->GetBoolean(0, &developer_mode_on));
995 profile->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode, 995 profile->GetPrefs()->SetBoolean(prefs::kExtensionsUIDeveloperMode,
996 developer_mode); 996 developer_mode_on);
997 } 997 }
998 998
999 void ExtensionSettingsHandler::HandleInspectMessage( 999 void ExtensionSettingsHandler::HandleInspectMessage(
1000 const base::ListValue* args) { 1000 const base::ListValue* args) {
1001 std::string extension_id; 1001 std::string extension_id;
1002 std::string render_process_id_str; 1002 std::string render_process_id_str;
1003 std::string render_view_id_str; 1003 std::string render_view_id_str;
1004 int render_process_id; 1004 int render_process_id;
1005 int render_view_id; 1005 int render_view_id;
1006 bool incognito; 1006 bool incognito;
(...skipping 523 matching lines...) Expand 10 before | Expand all | Expand 10 after
1530 extension_service_->EnableExtension(extension_id); 1530 extension_service_->EnableExtension(extension_id);
1531 } else { 1531 } else {
1532 ExtensionErrorReporter::GetInstance()->ReportError( 1532 ExtensionErrorReporter::GetInstance()->ReportError(
1533 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')), 1533 base::UTF8ToUTF16(JoinString(requirement_errors, ' ')),
1534 true); // Be noisy. 1534 true); // Be noisy.
1535 } 1535 }
1536 requirements_checker_.reset(); 1536 requirements_checker_.reset();
1537 } 1537 }
1538 1538
1539 } // namespace extensions 1539 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698