OLD | NEW |
---|---|
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 Loading... | |
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, |
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 Loading... | |
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. | |
Peter Kasting
2016/08/18 06:24:37
Nit: icon view -> security chip?
Kevin Bailey
2016/08/18 16:09:36
I'm trying to tell the reader where it goes. If I
Peter Kasting
2016/08/20 01:16:43
Well, we use the phrase "security chip" to describ
Kevin Bailey
2016/08/22 15:58:56
I think my version would be a bit verbose compared
Peter Kasting
2016/08/22 22:58:09
Never let that discourage you from leaving good co
| |
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. | |
327 // This uses a small state machine to filter false positives during | |
328 // page transition. | |
Peter Kasting
2016/08/18 06:24:37
Nit: No longer accurate
Kevin Bailey
2016/08/18 16:09:36
Done.
| |
329 bool ShouldShowSecurityChip() const; | |
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; |
333 | 340 |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 bool showing_security_chip_; | |
474 | |
466 // This is in case we're destroyed before the model loads. We need to make | 475 // This is in case we're destroyed before the model loads. We need to make |
467 // Add/RemoveObserver calls. | 476 // Add/RemoveObserver calls. |
468 TemplateURLService* template_url_service_; | 477 TemplateURLService* template_url_service_; |
469 | 478 |
470 // Tracks this preference to determine whether bookmark editing is allowed. | 479 // Tracks this preference to determine whether bookmark editing is allowed. |
471 BooleanPrefMember edit_bookmarks_enabled_; | 480 BooleanPrefMember edit_bookmarks_enabled_; |
472 | 481 |
473 // This is a debug state variable that stores if the WebContents was null | 482 // This is a debug state variable that stores if the WebContents was null |
474 // during the last RefreshPageAction. | 483 // during the last RefreshPageAction. |
475 bool web_contents_null_at_last_refresh_; | 484 bool web_contents_null_at_last_refresh_; |
476 | 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_ |
OLD | NEW |