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

Side by Side Diff: chrome/browser/extensions/extension_cookies_api.cc

Issue 9590002: JSONWriter cleanup: integrate pretty print into write options. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Fix merge conflict 7. Created 8 years, 9 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 // Implements the Chrome Extensions Cookies API. 5 // Implements the Chrome Extensions Cookies API.
6 6
7 #include "chrome/browser/extensions/extension_cookies_api.h" 7 #include "chrome/browser/extensions/extension_cookies_api.h"
8 8
9 #include "base/bind.h" 9 #include "base/bind.h"
10 #include "base/json/json_writer.h" 10 #include "base/json/json_writer.h"
(...skipping 83 matching lines...) Expand 10 before | Expand all | Expand 10 after
94 break; 94 break;
95 95
96 default: 96 default:
97 NOTREACHED(); 97 NOTREACHED();
98 } 98 }
99 dict->SetString(keys::kCauseKey, cause); 99 dict->SetString(keys::kCauseKey, cause);
100 100
101 args.Append(dict); 101 args.Append(dict);
102 102
103 std::string json_args; 103 std::string json_args;
104 base::JSONWriter::Write(&args, false, &json_args); 104 base::JSONWriter::Write(&args, &json_args);
105 GURL cookie_domain = 105 GURL cookie_domain =
106 extension_cookies_helpers::GetURLFromCanonicalCookie(*details->cookie); 106 extension_cookies_helpers::GetURLFromCanonicalCookie(*details->cookie);
107 DispatchEvent(profile, keys::kOnChanged, json_args, cookie_domain); 107 DispatchEvent(profile, keys::kOnChanged, json_args, cookie_domain);
108 } 108 }
109 109
110 void ExtensionCookiesEventRouter::DispatchEvent(Profile* profile, 110 void ExtensionCookiesEventRouter::DispatchEvent(Profile* profile,
111 const char* event_name, 111 const char* event_name,
112 const std::string& json_args, 112 const std::string& json_args,
113 GURL& cookie_domain) { 113 GURL& cookie_domain) {
114 if (profile && profile->GetExtensionEventRouter()) { 114 if (profile && profile->GetExtensionEventRouter()) {
(...skipping 419 matching lines...) Expand 10 before | Expand all | Expand 10 after
534 extension_cookies_helpers::CreateCookieStoreValue( 534 extension_cookies_helpers::CreateCookieStoreValue(
535 incognito_profile, incognito_tab_ids.release())); 535 incognito_profile, incognito_tab_ids.release()));
536 } 536 }
537 result_.reset(cookie_store_list); 537 result_.reset(cookie_store_list);
538 return true; 538 return true;
539 } 539 }
540 540
541 void GetAllCookieStoresFunction::Run() { 541 void GetAllCookieStoresFunction::Run() {
542 SendResponse(RunImpl()); 542 SendResponse(RunImpl());
543 } 543 }
OLDNEW
« no previous file with comments | « chrome/browser/extensions/extension_browser_event_router.cc ('k') | chrome/browser/extensions/extension_debugger_api.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698