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

Side by Side Diff: chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h

Issue 1935663002: New origin security indicator icons. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Respond to comments, and get the colors right on Mac OS X. Created 4 years, 7 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 unified diff | Download patch
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 6 #define CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
7 7
8 #import <Cocoa/Cocoa.h> 8 #import <Cocoa/Cocoa.h>
9 #include <stddef.h> 9 #include <stddef.h>
10 10
11 #include <memory> 11 #include <memory>
12 12
13 #include "base/macros.h" 13 #include "base/macros.h"
14 #include "base/strings/string16.h" 14 #include "base/strings/string16.h"
15 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h" 15 #include "chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.h"
16 #include "components/omnibox/browser/omnibox_view.h" 16 #include "components/omnibox/browser/omnibox_view.h"
17 #include "components/security_state/security_state_model.h"
17 18
18 class CommandUpdater; 19 class CommandUpdater;
19 class OmniboxPopupView; 20 class OmniboxPopupView;
20 class Profile; 21 class Profile;
21 22
22 namespace content { 23 namespace content {
23 class WebContents; 24 class WebContents;
24 } 25 }
25 26
26 namespace ui { 27 namespace ui {
27 class Clipboard; 28 class Clipboard;
28 } 29 }
29 30
30 // Implements OmniboxView on an AutocompleteTextField. 31 // Implements OmniboxView on an AutocompleteTextField.
31 class OmniboxViewMac : public OmniboxView, 32 class OmniboxViewMac : public OmniboxView,
32 public AutocompleteTextFieldObserver { 33 public AutocompleteTextFieldObserver {
33 public: 34 public:
34 static SkColor BaseTextColorSkia(bool in_dark_mode); 35 static SkColor BaseTextColorSkia(bool in_dark_mode);
35 static NSColor* BaseTextColor(bool in_dark_mode); 36 static NSColor* BaseTextColor(bool in_dark_mode);
37 static SkColor GetSecureTextColorSkia(
Evan Stade 2016/05/19 17:58:49 you only call this in one place, it doesn't seem l
palmer 2016/05/19 18:40:40 I had it that way at first, but groby suggested in
Peter Kasting 2016/05/19 18:43:21 Simpler is good.
palmer 2016/05/19 19:55:44 Done.
38 security_state::SecurityStateModel::SecurityLevel security_level,
39 bool in_dark_mode);
40 static NSColor* GetSecureTextColor(
41 security_state::SecurityStateModel::SecurityLevel security_level,
42 bool in_dark_mode);
36 43
37 OmniboxViewMac(OmniboxEditController* controller, 44 OmniboxViewMac(OmniboxEditController* controller,
38 Profile* profile, 45 Profile* profile,
39 CommandUpdater* command_updater, 46 CommandUpdater* command_updater,
40 AutocompleteTextField* field); 47 AutocompleteTextField* field);
41 ~OmniboxViewMac() override; 48 ~OmniboxViewMac() override;
42 49
43 // For use when switching tabs, this saves the current state onto the tab so 50 // For use when switching tabs, this saves the current state onto the tab so
44 // that it can be restored during a later call to Update(). 51 // that it can be restored during a later call to Update().
45 void SaveStateToTab(content::WebContents* tab); 52 void SaveStateToTab(content::WebContents* tab);
(...skipping 180 matching lines...) Expand 10 before | Expand all | Expand 10 after
226 NSRange coalesced_range_update_; 233 NSRange coalesced_range_update_;
227 234
228 // The time of the first character insert operation that has not yet been 235 // The time of the first character insert operation that has not yet been
229 // painted. Used to measure omnibox responsiveness with a histogram. 236 // painted. Used to measure omnibox responsiveness with a histogram.
230 base::TimeTicks insert_char_time_; 237 base::TimeTicks insert_char_time_;
231 238
232 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac); 239 DISALLOW_COPY_AND_ASSIGN(OmniboxViewMac);
233 }; 240 };
234 241
235 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_ 242 #endif // CHROME_BROWSER_UI_COCOA_OMNIBOX_OMNIBOX_VIEW_MAC_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698