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

Unified Diff: chrome/common/extensions/incognito_handler.cc

Issue 61823004: Move chrome/common/extensions/incognito_handler.h to src/extensions (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: rebase Created 7 years, 1 month 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 side-by-side diff with in-line comments
Download patch
Index: chrome/common/extensions/incognito_handler.cc
diff --git a/chrome/common/extensions/incognito_handler.cc b/chrome/common/extensions/incognito_handler.cc
deleted file mode 100644
index ca3148066fc283ecb32f8c8d06b3603939b02c95..0000000000000000000000000000000000000000
--- a/chrome/common/extensions/incognito_handler.cc
+++ /dev/null
@@ -1,76 +0,0 @@
-// Copyright (c) 2013 The Chromium Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style license that can be
-// found in the LICENSE file.
-
-#include "chrome/common/extensions/incognito_handler.h"
-
-#include "base/memory/scoped_ptr.h"
-#include "base/strings/utf_string_conversions.h"
-#include "base/values.h"
-#include "chrome/common/extensions/extension.h"
-#include "extensions/common/manifest_constants.h"
-
-namespace extensions {
-
-namespace keys = manifest_keys;
-
-IncognitoInfo::IncognitoInfo(bool incognito_split_mode)
- : split_mode(incognito_split_mode) {
-}
-
-IncognitoInfo::~IncognitoInfo() {
-}
-
-// static
-bool IncognitoInfo::IsSplitMode(const Extension* extension) {
- IncognitoInfo* info = static_cast<IncognitoInfo*>(
- extension->GetManifestData(keys::kIncognito));
- return info ? info->split_mode : false;
-}
-
-IncognitoHandler::IncognitoHandler() {
-}
-
-IncognitoHandler::~IncognitoHandler() {
-}
-
-bool IncognitoHandler::Parse(Extension* extension, string16* error) {
- if (!extension->manifest()->HasKey(keys::kIncognito)) {
- // Extensions and Chrome apps default to spanning mode.
- // Hosted and legacy packaged apps default to split mode.
- extension->SetManifestData(
- keys::kIncognito,
- new IncognitoInfo(extension->is_hosted_app() ||
- extension->is_legacy_packaged_app()));
- return true;
- }
-
- bool split_mode = false;
- std::string incognito_string;
- if (!extension->manifest()->GetString(keys::kIncognito, &incognito_string)) {
- *error = ASCIIToUTF16(manifest_errors::kInvalidIncognitoBehavior);
- return false;
- }
-
- if (incognito_string == manifest_values::kIncognitoSplit)
- split_mode = true;
- else if (incognito_string != manifest_values::kIncognitoSpanning) {
- // If incognito_string == kIncognitoSpanning, it is valid and
- // split_mode remains false.
- *error = ASCIIToUTF16(manifest_errors::kInvalidIncognitoBehavior);
- return false;
- }
-
- extension->SetManifestData(keys::kIncognito, new IncognitoInfo(split_mode));
- return true;
-}
-
-bool IncognitoHandler::AlwaysParseForType(Manifest::Type type) const {
- return true;
-}
-
-const std::vector<std::string> IncognitoHandler::Keys() const {
- return SingleKey(keys::kIncognito);
-}
-
-} // namespace extensions

Powered by Google App Engine
This is Rietveld 408576698