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

Unified Diff: chrome/common/instant_types.cc

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/instant_types.h ('k') | chrome/common/instant_types_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/common/instant_types.cc
diff --git a/chrome/common/instant_types.cc b/chrome/common/instant_types.cc
deleted file mode 100644
index 5555221e2a0a7ba9db1f728cd90b8bf289a323ae..0000000000000000000000000000000000000000
--- a/chrome/common/instant_types.cc
+++ /dev/null
@@ -1,138 +0,0 @@
-// Copyright 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.
-
-#include "chrome/common/instant_types.h"
-
-#include "base/strings/utf_string_conversions.h"
-#include "net/base/escape.h"
-
-namespace {
-
-std::string GetComponent(const std::string& url,
- const url::Component component) {
- return (component.len > 0) ? url.substr(component.begin, component.len) :
- std::string();
-}
-
-} // namespace
-
-InstantSuggestion::InstantSuggestion() {
-}
-
-InstantSuggestion::InstantSuggestion(const base::string16& in_text,
- const std::string& in_metadata)
- : text(in_text),
- metadata(in_metadata) {
-}
-
-InstantSuggestion::~InstantSuggestion() {
-}
-
-RGBAColor::RGBAColor()
- : r(0),
- g(0),
- b(0),
- a(0) {
-}
-
-RGBAColor::~RGBAColor() {
-}
-
-bool RGBAColor::operator==(const RGBAColor& rhs) const {
- return r == rhs.r &&
- g == rhs.g &&
- b == rhs.b &&
- a == rhs.a;
-}
-
-ThemeBackgroundInfo::ThemeBackgroundInfo()
- : using_default_theme(true),
- background_color(),
- text_color(),
- link_color(),
- text_color_light(),
- header_color(),
- section_border_color(),
- image_horizontal_alignment(THEME_BKGRND_IMAGE_ALIGN_CENTER),
- image_vertical_alignment(THEME_BKGRND_IMAGE_ALIGN_CENTER),
- image_tiling(THEME_BKGRND_IMAGE_NO_REPEAT),
- image_height(0),
- has_attribution(false),
- logo_alternate(false) {
-}
-
-ThemeBackgroundInfo::~ThemeBackgroundInfo() {
-}
-
-bool ThemeBackgroundInfo::operator==(const ThemeBackgroundInfo& rhs) const {
- return using_default_theme == rhs.using_default_theme &&
- background_color == rhs.background_color &&
- text_color == rhs.text_color &&
- link_color == rhs.link_color &&
- text_color_light == rhs.text_color_light &&
- header_color == rhs.header_color &&
- section_border_color == rhs.section_border_color &&
- theme_id == rhs.theme_id &&
- image_horizontal_alignment == rhs.image_horizontal_alignment &&
- image_vertical_alignment == rhs.image_vertical_alignment &&
- image_tiling == rhs.image_tiling &&
- image_height == rhs.image_height &&
- has_attribution == rhs.has_attribution &&
- logo_alternate == rhs.logo_alternate;
-}
-
-const char kSearchQueryKey[] = "q";
-const char kOriginalQueryKey[] = "oq";
-const char kRLZParameterKey[] = "rlz";
-const char kInputEncodingKey[] = "ie";
-const char kAssistedQueryStatsKey[] = "aqs";
-
-InstantMostVisitedItem::InstantMostVisitedItem() {}
-
-InstantMostVisitedItem::InstantMostVisitedItem(
- const InstantMostVisitedItem& other) = default;
-
-InstantMostVisitedItem::~InstantMostVisitedItem() {}
-
-EmbeddedSearchRequestParams::EmbeddedSearchRequestParams() {
-}
-
-EmbeddedSearchRequestParams::EmbeddedSearchRequestParams(const GURL& url) {
- const std::string& url_params(url.ref().empty()? url.query() : url.ref());
- url::Component query, key, value;
- query.len = static_cast<int>(url_params.size());
-
- const net::UnescapeRule::Type unescape_rules =
- net::UnescapeRule::SPOOFING_AND_CONTROL_CHARS |
- net::UnescapeRule::SPACES | net::UnescapeRule::PATH_SEPARATORS |
- net::UnescapeRule::URL_SPECIAL_CHARS_EXCEPT_PATH_SEPARATORS |
- net::UnescapeRule::NORMAL | net::UnescapeRule::REPLACE_PLUS_WITH_SPACE;
-
- while (url::ExtractQueryKeyValue(url_params.c_str(), &query, &key, &value)) {
- if (!key.is_nonempty())
- continue;
-
- std::string key_param(GetComponent(url_params, key));
- std::string value_param(GetComponent(url_params, value));
- if (key_param == kSearchQueryKey) {
- search_query = base::UTF8ToUTF16(net::UnescapeURLComponent(
- value_param, unescape_rules));
- } else if (key_param == kOriginalQueryKey) {
- original_query = base::UTF8ToUTF16(net::UnescapeURLComponent(
- value_param, unescape_rules));
- } else if (key_param == kRLZParameterKey) {
- rlz_parameter_value = net::UnescapeAndDecodeUTF8URLComponent(
- value_param, net::UnescapeRule::NORMAL);
- } else if (key_param == kInputEncodingKey) {
- input_encoding = net::UnescapeAndDecodeUTF8URLComponent(
- value_param, net::UnescapeRule::NORMAL);
- } else if (key_param == kAssistedQueryStatsKey) {
- assisted_query_stats = net::UnescapeAndDecodeUTF8URLComponent(
- value_param, net::UnescapeRule::NORMAL);
- }
- }
-}
-
-EmbeddedSearchRequestParams::~EmbeddedSearchRequestParams() {
-}
« no previous file with comments | « chrome/common/instant_types.h ('k') | chrome/common/instant_types_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698