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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
70 public gfx::AnimationDelegate, | 70 public gfx::AnimationDelegate, |
71 public ChromeOmniboxEditController, | 71 public ChromeOmniboxEditController, |
72 public DropdownBarHostDelegate, | 72 public DropdownBarHostDelegate, |
73 public TemplateURLServiceObserver, | 73 public TemplateURLServiceObserver, |
74 public zoom::ZoomEventManagerObserver { | 74 public zoom::ZoomEventManagerObserver { |
75 public: | 75 public: |
76 class Delegate { | 76 class Delegate { |
77 public: | 77 public: |
78 // Should return the current web contents. | 78 // Should return the current web contents. |
79 virtual content::WebContents* GetWebContents() = 0; | 79 virtual content::WebContents* GetWebContents() = 0; |
80 virtual const content::WebContents* GetWebContents() const = 0; | |
80 | 81 |
81 virtual ToolbarModel* GetToolbarModel() = 0; | 82 virtual ToolbarModel* GetToolbarModel() = 0; |
82 virtual const ToolbarModel* GetToolbarModel() const = 0; | 83 virtual const ToolbarModel* GetToolbarModel() const = 0; |
83 | 84 |
84 // Creates PageActionImageView. Caller gets an ownership. | 85 // Creates PageActionImageView. Caller gets an ownership. |
85 virtual PageActionImageView* CreatePageActionImageView( | 86 virtual PageActionImageView* CreatePageActionImageView( |
86 LocationBarView* owner, | 87 LocationBarView* owner, |
87 ExtensionAction* action) = 0; | 88 ExtensionAction* action) = 0; |
88 | 89 |
89 // Returns ContentSettingBubbleModelDelegate. | 90 // Returns ContentSettingBubbleModelDelegate. |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
305 // Updates the Translate icon based on the current tab's Translate status. | 306 // Updates the Translate icon based on the current tab's Translate status. |
306 void RefreshTranslateIcon(); | 307 void RefreshTranslateIcon(); |
307 | 308 |
308 // Updates |manage_passwords_icon_view_|. Returns true if visibility changed. | 309 // Updates |manage_passwords_icon_view_|. Returns true if visibility changed. |
309 bool RefreshManagePasswordsIconView(); | 310 bool RefreshManagePasswordsIconView(); |
310 | 311 |
311 // Helper to show the first run info bubble. | 312 // Helper to show the first run info bubble. |
312 void ShowFirstRunBubbleInternal(); | 313 void ShowFirstRunBubbleInternal(); |
313 | 314 |
314 // Returns text describing the URL's security level, to be placed in the | 315 // Returns text describing the URL's security level, to be placed in the |
315 // security chip. | 316 // security chip. |
Peter Kasting
2016/12/20 01:59:31
This is somewhat misleading, since the extension n
meacer
2016/12/21 01:38:56
Sorry I missed your naming suggestion in the previ
| |
316 base::string16 GetSecurityText() const; | 317 base::string16 GetSecurityText(const GURL& url, |
318 content::WebContents* contents) const; | |
Peter Kasting
2016/12/20 01:59:31
Don't add these args; both callers pass the same v
meacer
2016/12/21 01:38:56
Done.
| |
317 | 319 |
318 bool ShouldShowKeywordBubble() const; | 320 bool ShouldShowKeywordBubble() const; |
319 | 321 |
320 // Returns true when the current page is explicitly secure or insecure. | 322 // Returns true if any of the following is true: |
321 // In these cases, we should show the state of the security chip. | 323 // - the current page is explicitly secure or insecure |
322 bool ShouldShowSecurityChip() const; | 324 // - the current page URL is a chrome-extension:// URL. |
325 bool ShouldShowSecurityText() const; | |
323 | 326 |
324 // Returns true if the chip should be animated | 327 // Returns true if the security text should be animated |
Peter Kasting
2016/12/20 01:59:31
Nit: Trailing period
meacer
2016/12/21 01:38:56
Done.
| |
325 bool ShouldAnimateSecurityChip() const; | 328 bool ShouldAnimateSecurityText() const; |
326 | 329 |
327 // 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 |
328 // 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 |
329 // current position of the omnibox, calculates what value the desired | 332 // current position of the omnibox, calculates what value the desired |
330 // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_| | 333 // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_| |
331 // 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 |
332 // 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 |
333 // 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 |
334 // directions from its current location. | 337 // directions from its current location. |
335 double GetValueForAnimation(bool hide) const; | 338 double GetValueForAnimation(bool hide) const; |
(...skipping 130 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
466 BooleanPrefMember edit_bookmarks_enabled_; | 469 BooleanPrefMember edit_bookmarks_enabled_; |
467 | 470 |
468 // This is a debug state variable that stores if the WebContents was null | 471 // This is a debug state variable that stores if the WebContents was null |
469 // during the last RefreshPageAction. | 472 // during the last RefreshPageAction. |
470 bool web_contents_null_at_last_refresh_; | 473 bool web_contents_null_at_last_refresh_; |
471 | 474 |
472 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 475 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
473 }; | 476 }; |
474 | 477 |
475 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 478 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |