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

Side by Side Diff: chrome/browser/extensions/api/storage/settings_apitest.cc

Issue 16915006: Convert most of extensions and some other random stuff to using the base namespace for Values. (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 "base/bind.h" 5 #include "base/bind.h"
6 #include "base/json/json_writer.h" 6 #include "base/json/json_writer.h"
7 #include "base/memory/ref_counted.h" 7 #include "base/memory/ref_counted.h"
8 #include "base/run_loop.h" 8 #include "base/run_loop.h"
9 #include "chrome/browser/extensions/api/storage/settings_frontend.h" 9 #include "chrome/browser/extensions/api/storage/settings_frontend.h"
10 #include "chrome/browser/extensions/api/storage/settings_namespace.h" 10 #include "chrome/browser/extensions/api/storage/settings_namespace.h"
(...skipping 178 matching lines...) Expand 10 before | Expand all | Expand 10 after
189 CreateMessage(settings_namespace, normal_action, is_final_action)); 189 CreateMessage(settings_namespace, normal_action, is_final_action));
190 listener_incognito.Reply( 190 listener_incognito.Reply(
191 CreateMessage(settings_namespace, incognito_action, is_final_action)); 191 CreateMessage(settings_namespace, incognito_action, is_final_action));
192 return extension; 192 return extension;
193 } 193 }
194 194
195 std::string CreateMessage( 195 std::string CreateMessage(
196 Namespace settings_namespace, 196 Namespace settings_namespace,
197 const std::string& action, 197 const std::string& action,
198 bool is_final_action) { 198 bool is_final_action) {
199 scoped_ptr<DictionaryValue> message(new DictionaryValue()); 199 scoped_ptr<base::DictionaryValue> message(new base::DictionaryValue());
200 message->SetString("namespace", ToString(settings_namespace)); 200 message->SetString("namespace", ToString(settings_namespace));
201 message->SetString("action", action); 201 message->SetString("action", action);
202 message->SetBoolean("isFinalAction", is_final_action); 202 message->SetBoolean("isFinalAction", is_final_action);
203 std::string message_json; 203 std::string message_json;
204 base::JSONWriter::Write(message.get(), &message_json); 204 base::JSONWriter::Write(message.get(), &message_json);
205 return message_json; 205 return message_json;
206 } 206 }
207 207
208 void InitSyncWithSyncableService( 208 void InitSyncWithSyncableService(
209 syncer::SyncChangeProcessor* sync_processor, 209 syncer::SyncChangeProcessor* sync_processor,
(...skipping 337 matching lines...) Expand 10 before | Expand all | Expand 10 after
547 SettingsFrontend* frontend = 547 SettingsFrontend* frontend =
548 browser()->profile()->GetExtensionService()->settings_frontend(); 548 browser()->profile()->GetExtensionService()->settings_frontend();
549 frontend->DisableStorageForTesting(MANAGED); 549 frontend->DisableStorageForTesting(MANAGED);
550 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED)); 550 EXPECT_FALSE(frontend->IsStorageEnabled(MANAGED));
551 // Now run the extension. 551 // Now run the extension.
552 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled")) 552 ASSERT_TRUE(RunExtensionTest("settings/managed_storage_disabled"))
553 << message_; 553 << message_;
554 } 554 }
555 555
556 } // namespace extensions 556 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698