1 // Copyright 2018 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4 
5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_THEME_H_
6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_THEME_H_
7 
8 #include "components/security_state/core/security_state.h"
9 #include "third_party/skia/include/core/SkColor.h"
10 
11 namespace ui {
12 class ThemeProvider;
13 }
14 
15 // A part of the omnibox (location bar, location bar decoration, or dropdown).
16 enum class OmniboxPart {
17   LOCATION_BAR_BACKGROUND,
18   LOCATION_BAR_CLEAR_ALL,
19   LOCATION_BAR_SELECTED_KEYWORD,
20   LOCATION_BAR_TEXT_DEFAULT,
21   LOCATION_BAR_TEXT_DIMMED,
22   LOCATION_BAR_BUBBLE_OUTLINE,
23 
24   RESULTS_BACKGROUND,  // Background of the results dropdown.
25   RESULTS_ICON,
26   RESULTS_TEXT_DEFAULT,
27   RESULTS_TEXT_DIMMED,
28   RESULTS_TEXT_URL,
29   RESULTS_FOCUS_BAR,  // Vertical bar indicating focus, only used when
30                       // #omnibox-refined-focus-ui is enabled
31   RESULTS_BUTTON_BORDER,
32 };
33 
34 // An optional state for a given |OmniboxPart|.
35 enum class OmniboxPartState {
36   NORMAL,
37   HOVERED,
38   SELECTED,
39 };
40 
41 // Returns the color for the given |part| and |tint|. An optional |state| can be
42 // provided for OmniboxParts that support stateful colors.
43 SkColor GetOmniboxColor(const ui::ThemeProvider* theme_provider,
44                         OmniboxPart part,
45                         OmniboxPartState state = OmniboxPartState::NORMAL);
46 
47 // Returns the color of the security chip given |tint| and |security_level|.
48 SkColor GetOmniboxSecurityChipColor(
49     const ui::ThemeProvider* theme_provider,
50     security_state::SecurityLevel security_level);
51 
52 float GetOmniboxStateOpacity(OmniboxPartState state);
53 
54 #endif  // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_THEME_H_
55