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

Side by Side Diff: chrome/browser/extensions/api/cookies/cookies_api.cc

Issue 1392973005: Get rid of CookieMonster::Delegate typedef. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 2 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
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_cookie_monster_delegate.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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/api/cookies/cookies_api.h" 7 #include "chrome/browser/extensions/api/cookies/cookies_api.h"
8 8
9 #include <vector> 9 #include <vector>
10 10
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after
141 base::DictionaryValue* dict = new base::DictionaryValue(); 141 base::DictionaryValue* dict = new base::DictionaryValue();
142 dict->SetBoolean(keys::kRemovedKey, details->removed); 142 dict->SetBoolean(keys::kRemovedKey, details->removed);
143 143
144 scoped_ptr<cookies::Cookie> cookie(cookies_helpers::CreateCookie( 144 scoped_ptr<cookies::Cookie> cookie(cookies_helpers::CreateCookie(
145 *details->cookie, cookies_helpers::GetStoreIdFromProfile(profile))); 145 *details->cookie, cookies_helpers::GetStoreIdFromProfile(profile)));
146 dict->Set(keys::kCookieKey, cookie->ToValue().release()); 146 dict->Set(keys::kCookieKey, cookie->ToValue().release());
147 147
148 // Map the internal cause to an external string. 148 // Map the internal cause to an external string.
149 std::string cause; 149 std::string cause;
150 switch (details->cause) { 150 switch (details->cause) {
151 case net::CookieMonster::Delegate::CHANGE_COOKIE_EXPLICIT: 151 case net::CookieMonsterDelegate::CHANGE_COOKIE_EXPLICIT:
152 cause = keys::kExplicitChangeCause; 152 cause = keys::kExplicitChangeCause;
153 break; 153 break;
154 154
155 case net::CookieMonster::Delegate::CHANGE_COOKIE_OVERWRITE: 155 case net::CookieMonsterDelegate::CHANGE_COOKIE_OVERWRITE:
156 cause = keys::kOverwriteChangeCause; 156 cause = keys::kOverwriteChangeCause;
157 break; 157 break;
158 158
159 case net::CookieMonster::Delegate::CHANGE_COOKIE_EXPIRED: 159 case net::CookieMonsterDelegate::CHANGE_COOKIE_EXPIRED:
160 cause = keys::kExpiredChangeCause; 160 cause = keys::kExpiredChangeCause;
161 break; 161 break;
162 162
163 case net::CookieMonster::Delegate::CHANGE_COOKIE_EVICTED: 163 case net::CookieMonsterDelegate::CHANGE_COOKIE_EVICTED:
164 cause = keys::kEvictedChangeCause; 164 cause = keys::kEvictedChangeCause;
165 break; 165 break;
166 166
167 case net::CookieMonster::Delegate::CHANGE_COOKIE_EXPIRED_OVERWRITE: 167 case net::CookieMonsterDelegate::CHANGE_COOKIE_EXPIRED_OVERWRITE:
168 cause = keys::kExpiredOverwriteChangeCause; 168 cause = keys::kExpiredOverwriteChangeCause;
169 break; 169 break;
170 170
171 default: 171 default:
172 NOTREACHED(); 172 NOTREACHED();
173 } 173 }
174 dict->SetString(keys::kCauseKey, cause); 174 dict->SetString(keys::kCauseKey, cause);
175 175
176 args->Append(dict); 176 args->Append(dict);
177 177
(...skipping 400 matching lines...) Expand 10 before | Expand all | Expand 10 after
578 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() { 578 BrowserContextKeyedAPIFactory<CookiesAPI>* CookiesAPI::GetFactoryInstance() {
579 return g_factory.Pointer(); 579 return g_factory.Pointer();
580 } 580 }
581 581
582 void CookiesAPI::OnListenerAdded(const EventListenerInfo& details) { 582 void CookiesAPI::OnListenerAdded(const EventListenerInfo& details) {
583 cookies_event_router_.reset(new CookiesEventRouter(browser_context_)); 583 cookies_event_router_.reset(new CookiesEventRouter(browser_context_));
584 EventRouter::Get(browser_context_)->UnregisterObserver(this); 584 EventRouter::Get(browser_context_)->UnregisterObserver(this);
585 } 585 }
586 586
587 } // namespace extensions 587 } // namespace extensions
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/extensions/extension_cookie_monster_delegate.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698