Revert of Change the callsites of InterfacePtr<> methods which directly deal with...
[chromium-blink-merge.git] / content / public / common / window_container_type.cc
blobec3b12c6364bfda16a3f8219a3b1fe076697bdce
1 // Copyright (c) 2011 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 "content/public/common/window_container_type.h"
7 #include "base/strings/string_util.h"
8 #include "third_party/WebKit/public/platform/WebString.h"
9 #include "third_party/WebKit/public/platform/WebVector.h"
10 #include "third_party/WebKit/public/web/WebWindowFeatures.h"
12 namespace {
14 const char kBackground[] = "background";
15 const char kPersistent[] = "persistent";
17 } // namespace
19 WindowContainerType WindowFeaturesToContainerType(
20 const blink::WebWindowFeatures& window_features) {
21 bool background = false;
22 bool persistent = false;
24 for (size_t i = 0; i < window_features.additionalFeatures.size(); ++i) {
25 if (LowerCaseEqualsASCII(window_features.additionalFeatures[i],
26 kBackground))
27 background = true;
28 else if (LowerCaseEqualsASCII(window_features.additionalFeatures[i],
29 kPersistent))
30 persistent = true;
33 if (background) {
34 if (persistent)
35 return WINDOW_CONTAINER_TYPE_PERSISTENT;
36 else
37 return WINDOW_CONTAINER_TYPE_BACKGROUND;
38 } else {
39 return WINDOW_CONTAINER_TYPE_NORMAL;