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

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: Removed unnecessary method, formatting 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 300 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 base::string16 GetSecurityText() const;
321 bool ShouldShowKeywordBubble() const; 322 bool ShouldShowKeywordBubble() const;
322 bool ShouldShowEVBubble() const; 323 bool ShouldShowEVBubble() const;
324 std::string TrimSite(const std::string& url) const;
Peter Kasting 2016/08/15 23:29:49 Nit: Neither of the new functions here is 100% cle
Kevin Bailey 2016/08/16 16:39:36 Done.
325
326 // Returns true if the security chip should be displayed and is ready.
Peter Kasting 2016/08/15 23:29:49 Nit: What does "and is ready" mean from the perspe
Kevin Bailey 2016/08/16 16:39:36 Done.
327 // This uses a small state machine to filter false positives during
328 // page transition.
329 bool ShouldShowSecurityChip() const;
323 330
324 // Used to "reverse" the URL showing/hiding animations, since we use separate 331 // 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 332 // animations whose curves are not true inverses of each other. Based on the
326 // current position of the omnibox, calculates what value the desired 333 // current position of the omnibox, calculates what value the desired
327 // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_| 334 // 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 335 // 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 336 // 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 337 // this value, and start it running, and the text will appear to reverse
331 // directions from its current location. 338 // directions from its current location.
332 double GetValueForAnimation(bool hide) const; 339 double GetValueForAnimation(bool hide) const;
(...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after
456 gfx::SlideAnimation size_animation_; 463 gfx::SlideAnimation size_animation_;
457 464
458 // Whether we're in popup mode. This value also controls whether the location 465 // Whether we're in popup mode. This value also controls whether the location
459 // bar is read-only. 466 // bar is read-only.
460 const bool is_popup_mode_; 467 const bool is_popup_mode_;
461 468
462 // True if we should show a focus rect while the location entry field is 469 // True if we should show a focus rect while the location entry field is
463 // focused. Used when the toolbar is in full keyboard accessibility mode. 470 // focused. Used when the toolbar is in full keyboard accessibility mode.
464 bool show_focus_rect_; 471 bool show_focus_rect_;
465 472
473 struct LoadState {
474 // Used to monitor the state of page loading, forward, back, etc.
475 // and align a security state with a URL.
476 std::string last_site_;
477 int last_index_;
478 bool last_returned_;
479 };
Peter Kasting 2016/08/15 23:29:49 Nit: We normally put struct defs at the top of the
Kevin Bailey 2016/08/16 16:39:36 Done.
480 std::unique_ptr<LoadState> load_state_;
481
466 // This is in case we're destroyed before the model loads. We need to make 482 // This is in case we're destroyed before the model loads. We need to make
467 // Add/RemoveObserver calls. 483 // Add/RemoveObserver calls.
468 TemplateURLService* template_url_service_; 484 TemplateURLService* template_url_service_;
469 485
470 // Tracks this preference to determine whether bookmark editing is allowed. 486 // Tracks this preference to determine whether bookmark editing is allowed.
471 BooleanPrefMember edit_bookmarks_enabled_; 487 BooleanPrefMember edit_bookmarks_enabled_;
472 488
473 // This is a debug state variable that stores if the WebContents was null 489 // This is a debug state variable that stores if the WebContents was null
474 // during the last RefreshPageAction. 490 // during the last RefreshPageAction.
475 bool web_contents_null_at_last_refresh_; 491 bool web_contents_null_at_last_refresh_;
476 492
477 DISALLOW_COPY_AND_ASSIGN(LocationBarView); 493 DISALLOW_COPY_AND_ASSIGN(LocationBarView);
478 }; 494 };
479 495
480 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ 496 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698