ozone: Handle pressure and tilt for stylus devices
[chromium-blink-merge.git] / net / cookies / cookie_constants.cc
blob05fe22ea437902b90bfb8729cec551f8687a3af9
1 // Copyright 2013 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
5 #include "net/cookies/cookie_constants.h"
7 #include "base/logging.h"
8 #include "base/strings/string_util.h"
10 namespace net {
12 namespace {
13 const char kPriorityLow[] = "low";
14 const char kPriorityMedium[] = "medium";
15 const char kPriorityHigh[] = "high";
16 } // namespace
18 NET_EXPORT const std::string CookiePriorityToString(CookiePriority priority) {
19 switch(priority) {
20 case COOKIE_PRIORITY_HIGH:
21 return kPriorityHigh;
22 case COOKIE_PRIORITY_MEDIUM:
23 return kPriorityMedium;
24 case COOKIE_PRIORITY_LOW:
25 return kPriorityLow;
26 default:
27 NOTREACHED();
29 return std::string();
32 NET_EXPORT CookiePriority StringToCookiePriority(const std::string& priority) {
33 std::string priority_comp = base::ToLowerASCII(priority);
35 if (priority_comp == kPriorityHigh)
36 return COOKIE_PRIORITY_HIGH;
37 if (priority_comp == kPriorityMedium)
38 return COOKIE_PRIORITY_MEDIUM;
39 if (priority_comp == kPriorityLow)
40 return COOKIE_PRIORITY_LOW;
42 return COOKIE_PRIORITY_DEFAULT;
45 } // namespace net