Chromium Code Reviews| Index: chrome/browser/ui/search/search_types.h |
| diff --git a/chrome/browser/ui/search/search_types.h b/chrome/browser/ui/search/search_types.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..038997d8e56e75f238a78f2472c4ac9e7f15145f |
| --- /dev/null |
| +++ b/chrome/browser/ui/search/search_types.h |
| @@ -0,0 +1,60 @@ |
| +// 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_BROWSER_UI_SEARCH_SEARCH_TYPES_H_ |
| +#define CHROME_BROWSER_UI_SEARCH_SEARCH_TYPES_H_ |
| +#pragma once |
| + |
| +namespace chrome { |
| +namespace search { |
| + |
| +struct Mode { |
|
sky
2012/06/21 18:26:49
Add a description.
dhollowa
2012/06/21 22:16:43
Done.
|
| + enum Type { |
| + // The default state means anything but the following states. |
| + MODE_DEFAULT, |
| + |
| + // On the NTP page but the NTP isn't in a state that we should show it. |
| + MODE_NTP_LOADING, |
| + |
| + // On the NTP page and the NTP is ready to be displayed. |
| + MODE_NTP, |
| + |
| + // Any of the following: |
| + // . on the ntp and modified the omnibox in some way. |
| + // . on a search results page. |
| + // . the omnibox has focus. |
| + MODE_SEARCH, |
| + }; |
| + |
| + Mode() : mode(MODE_DEFAULT), animate(false) { |
| + } |
| + |
| + Mode(Type in_mode, bool in_animate) : mode(in_mode), animate(in_animate) { |
| + } |
| + |
| + bool operator==(const Mode& rhs) const { |
| + return mode == rhs.mode; |
| + // |animate| is transient. It doesn't count. |
| + } |
| + |
| + bool is_default() const { |
| + return mode == MODE_DEFAULT; |
| + } |
| + |
| + bool is_ntp() const { |
| + return mode == MODE_NTP || mode == MODE_NTP_LOADING; |
| + } |
| + |
| + bool is_search() const { |
| + return mode == MODE_SEARCH; |
| + } |
| + |
| + Type mode; |
| + bool animate; |
|
sky
2012/06/21 18:26:49
Add a description for animate.
dhollowa
2012/06/21 22:16:43
Done.
|
| +}; |
| + |
| +} // namespace search |
| +} // namespace chrome |
| + |
| +#endif // CHROME_BROWSER_UI_SEARCH_SEARCH_TYPES_H_ |