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

Unified Diff: chrome/browser/spellchecker/spellcheck_action.cc

Issue 2159283003: [WIP][DO NOT LAND] Componentize spellcheck Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 5 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/spellchecker/spellcheck_action.cc
diff --git a/chrome/browser/spellchecker/spellcheck_action.cc b/chrome/browser/spellchecker/spellcheck_action.cc
deleted file mode 100644
index 6525b675b3320de6500ef99c86d1696a93970b1b..0000000000000000000000000000000000000000
--- a/chrome/browser/spellchecker/spellcheck_action.cc
+++ /dev/null
@@ -1,74 +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/browser/spellchecker/spellcheck_action.h"
-
-#include "base/logging.h"
-#include "base/values.h"
-
-SpellcheckAction::SpellcheckAction() : type_(TYPE_PENDING), index_(-1) {}
-
-SpellcheckAction::SpellcheckAction(SpellcheckActionType type,
- int index,
- base::string16 value)
- : type_(type), index_(index), value_(value) {}
-
-SpellcheckAction::~SpellcheckAction() {}
-
-bool SpellcheckAction::IsFinal() const {
- return type_ == TYPE_ADD_TO_DICT ||
- type_ == TYPE_IGNORE ||
- type_ == TYPE_IN_DICTIONARY ||
- type_ == TYPE_MANUALLY_CORRECTED ||
- type_ == TYPE_NO_ACTION ||
- type_ == TYPE_SELECT;
-}
-
-void SpellcheckAction::Finalize() {
- switch (type_) {
- case TYPE_PENDING:
- type_ = TYPE_NO_ACTION;
- break;
- case TYPE_PENDING_IGNORE:
- type_ = TYPE_IGNORE;
- break;
- default:
- DCHECK(IsFinal());
- break;
- }
-}
-
-base::DictionaryValue* SpellcheckAction::Serialize() const {
- base::DictionaryValue* result = new base::DictionaryValue;
- switch (type_) {
- case TYPE_SELECT:
- result->SetString("actionType", "SELECT");
- result->SetInteger("actionTargetIndex", index_);
- break;
- case TYPE_ADD_TO_DICT:
- result->SetString("actionType", "ADD_TO_DICT");
- break;
- case TYPE_IGNORE:
- result->SetString("actionType", "IGNORE");
- break;
- case TYPE_IN_DICTIONARY:
- result->SetString("actionType", "IN_DICTIONARY");
- break;
- case TYPE_NO_ACTION:
- result->SetString("actionType", "NO_ACTION");
- break;
- case TYPE_MANUALLY_CORRECTED:
- result->SetString("actionType", "MANUALLY_CORRECTED");
- result->SetString("actionTargetValue", value_);
- break;
- case TYPE_PENDING:
- case TYPE_PENDING_IGNORE:
- result->SetString("actionType", "PENDING");
- break;
- default:
- NOTREACHED();
- break;
- }
- return result;
-}
« no previous file with comments | « chrome/browser/spellchecker/spellcheck_action.h ('k') | chrome/browser/spellchecker/spellcheck_action_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698