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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_view.h

Issue 2144903004: New location security strings and animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Don't animate if level is same Created 4 years, 4 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_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 5 #ifndef CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 6 #define CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
7 7
8 #include <stddef.h> 8 #include <stddef.h>
9 9
10 #include <string> 10 #include <string>
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after
102 102
103 protected: 103 protected:
104 virtual ~Delegate() {} 104 virtual ~Delegate() {}
105 }; 105 };
106 106
107 enum ColorKind { 107 enum ColorKind {
108 BACKGROUND = 0, 108 BACKGROUND = 0,
109 TEXT, 109 TEXT,
110 SELECTED_TEXT, 110 SELECTED_TEXT,
111 DEEMPHASIZED_TEXT, 111 DEEMPHASIZED_TEXT,
112 EV_BUBBLE_TEXT_AND_BORDER, 112 SECURITY_CHIP_TEXT_AND_BORDER,
Peter Kasting 2016/08/20 01:16:43 Nit: MD no longer puts a border around this, so mi
Kevin Bailey 2016/08/22 15:58:56 Done, but to avoid having to follow a fickle UI, p
Peter Kasting 2016/08/22 22:58:09 I think leaving TEXT is good. If that wasn't ther
113 }; 113 };
114 114
115 // The location bar view's class name. 115 // The location bar view's class name.
116 static const char kViewClassName[]; 116 static const char kViewClassName[];
117 117
118 LocationBarView(Browser* browser, 118 LocationBarView(Browser* browser,
119 Profile* profile, 119 Profile* profile,
120 CommandUpdater* command_updater, 120 CommandUpdater* command_updater,
121 Delegate* delegate, 121 Delegate* delegate,
122 bool is_popup_mode); 122 bool is_popup_mode);
(...skipping 188 matching lines...) Expand 10 before | Expand all | Expand 10 after
311 311
312 // Updates |manage_passwords_icon_view_|. Returns true if visibility changed. 312 // Updates |manage_passwords_icon_view_|. Returns true if visibility changed.
313 bool RefreshManagePasswordsIconView(); 313 bool RefreshManagePasswordsIconView();
314 314
315 // Helper to show the first run info bubble. 315 // Helper to show the first run info bubble.
316 void ShowFirstRunBubbleInternal(); 316 void ShowFirstRunBubbleInternal();
317 317
318 // Returns true if the suggest text is valid. 318 // Returns true if the suggest text is valid.
319 bool HasValidSuggestText() const; 319 bool HasValidSuggestText() const;
320 320
321 // Returns text describing the URL's security level, for the icon view.
322 base::string16 GetSecurityText() const;
321 bool ShouldShowKeywordBubble() const; 323 bool ShouldShowKeywordBubble() const;
322 bool ShouldShowEVBubble() const; 324 bool ShouldShowEVBubble() const;
323 325
326 // Returns true if the security chip should be displayed (if it has a
327 // verified security level.)
328 bool ShouldShowSecurityChip() const;
329
324 // Used to "reverse" the URL showing/hiding animations, since we use separate 330 // Used to "reverse" the URL showing/hiding animations, since we use separate
325 // animations whose curves are not true inverses of each other. Based on the 331 // animations whose curves are not true inverses of each other. Based on the
326 // current position of the omnibox, calculates what value the desired 332 // current position of the omnibox, calculates what value the desired
327 // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_| 333 // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_|
328 // if it's false) should be set to in order to produce the same omnibox 334 // if it's false) should be set to in order to produce the same omnibox
329 // position. This way we can stop the old animation, set the new animation to 335 // position. This way we can stop the old animation, set the new animation to
330 // this value, and start it running, and the text will appear to reverse 336 // this value, and start it running, and the text will appear to reverse
331 // directions from its current location. 337 // directions from its current location.
332 double GetValueForAnimation(bool hide) const; 338 double GetValueForAnimation(bool hide) const;
333 339
(...skipping 133 matching lines...) Expand 10 before | Expand all | Expand 10 after
467 // Add/RemoveObserver calls. 473 // Add/RemoveObserver calls.
468 TemplateURLService* template_url_service_; 474 TemplateURLService* template_url_service_;
469 475
470 // Tracks this preference to determine whether bookmark editing is allowed. 476 // Tracks this preference to determine whether bookmark editing is allowed.
471 BooleanPrefMember edit_bookmarks_enabled_; 477 BooleanPrefMember edit_bookmarks_enabled_;
472 478
473 // This is a debug state variable that stores if the WebContents was null 479 // This is a debug state variable that stores if the WebContents was null
474 // during the last RefreshPageAction. 480 // during the last RefreshPageAction.
475 bool web_contents_null_at_last_refresh_; 481 bool web_contents_null_at_last_refresh_;
476 482
483 // Used to avoid animating if security level didn't change.
484 security_state::SecurityStateModel::SecurityLevel previous_security_level_;
485
477 DISALLOW_COPY_AND_ASSIGN(LocationBarView); 486 DISALLOW_COPY_AND_ASSIGN(LocationBarView);
478 }; 487 };
479 488
480 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 489 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698