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

Unified Diff: chrome/common/search_types.h

Issue 2122903002: Move search-related files from chrome/common to chrome/common/search (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move search-related files 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
« no previous file with comments | « chrome/common/search/search_urls_unittest.cc ('k') | chrome/common/search_urls.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/search_types.h
diff --git a/chrome/common/search_types.h b/chrome/common/search_types.h
deleted file mode 100644
index 15cb8789caa4c82d789637d92a6187c4d9bc4d74..0000000000000000000000000000000000000000
--- a/chrome/common/search_types.h
+++ /dev/null
@@ -1,90 +0,0 @@
-// Copyright (c) 2012 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.
-
-#ifndef CHROME_COMMON_SEARCH_TYPES_H_
-#define CHROME_COMMON_SEARCH_TYPES_H_
-
-// The Mode structure encodes the visual states encountered when interacting
-// with the NTP and the Omnibox.
-struct SearchMode {
- // The visual state that applies to the current interaction.
- enum Type {
- // The default state means anything but the following states.
- MODE_DEFAULT,
-
- // On the NTP page and the NTP is ready to be displayed.
- MODE_NTP,
-
- // The Omnibox is modified in some way, either on the NTP or not.
- MODE_SEARCH_SUGGESTIONS,
-
- // On a search results page.
- MODE_SEARCH_RESULTS,
- };
-
- // The kind of page from which the user initiated the current search.
- enum Origin {
- // The user is searching from some random page.
- ORIGIN_DEFAULT = 0,
-
- // The user is searching from the NTP.
- ORIGIN_NTP,
-
- // The user is searching from a search results page.
- ORIGIN_SEARCH,
- };
-
- SearchMode() : mode(MODE_DEFAULT), origin(ORIGIN_DEFAULT) {
- }
-
- SearchMode(Type in_mode, Origin in_origin)
- : mode(in_mode),
- origin(in_origin) {
- }
-
- bool operator==(const SearchMode& rhs) const {
- return mode == rhs.mode && origin == rhs.origin;
- }
-
- bool operator!=(const SearchMode& rhs) const {
- return !(*this == rhs);
- }
-
- bool is_default() const {
- return mode == MODE_DEFAULT;
- }
-
- bool is_ntp() const {
- return mode == MODE_NTP;
- }
-
- bool is_search() const {
- return mode == MODE_SEARCH_SUGGESTIONS || mode == MODE_SEARCH_RESULTS;
- }
-
- bool is_search_results() const {
- return mode == MODE_SEARCH_RESULTS;
- }
-
- bool is_search_suggestions() const {
- return mode == MODE_SEARCH_SUGGESTIONS;
- }
-
- bool is_origin_default() const {
- return origin == ORIGIN_DEFAULT;
- }
-
- bool is_origin_search() const {
- return origin == ORIGIN_SEARCH;
- }
-
- bool is_origin_ntp() const {
- return origin == ORIGIN_NTP;
- }
-
- Type mode;
- Origin origin;
-};
-
-#endif // CHROME_COMMON_SEARCH_TYPES_H_
« no previous file with comments | « chrome/common/search/search_urls_unittest.cc ('k') | chrome/common/search_urls.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698