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 <string> | 8 #include <string> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
(...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
249 | 249 |
250 // views::View: | 250 // views::View: |
251 virtual bool HasFocus() const OVERRIDE; | 251 virtual bool HasFocus() const OVERRIDE; |
252 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; | 252 virtual void GetAccessibleState(ui::AXViewState* state) OVERRIDE; |
253 virtual gfx::Size GetPreferredSize() const OVERRIDE; | 253 virtual gfx::Size GetPreferredSize() const OVERRIDE; |
254 virtual void Layout() OVERRIDE; | 254 virtual void Layout() OVERRIDE; |
255 | 255 |
256 // OmniboxEditController: | 256 // OmniboxEditController: |
257 virtual void Update(const content::WebContents* contents) OVERRIDE; | 257 virtual void Update(const content::WebContents* contents) OVERRIDE; |
258 virtual void ShowURL() OVERRIDE; | 258 virtual void ShowURL() OVERRIDE; |
259 virtual void EndOriginChipAnimations() OVERRIDE; | |
259 virtual ToolbarModel* GetToolbarModel() OVERRIDE; | 260 virtual ToolbarModel* GetToolbarModel() OVERRIDE; |
260 virtual content::WebContents* GetWebContents() OVERRIDE; | 261 virtual content::WebContents* GetWebContents() OVERRIDE; |
261 | 262 |
262 // Thickness of the edges of the omnibox background images, in normal mode. | 263 // Thickness of the edges of the omnibox background images, in normal mode. |
263 static const int kNormalEdgeThickness; | 264 static const int kNormalEdgeThickness; |
264 // The same, but for popup mode. | 265 // The same, but for popup mode. |
265 static const int kPopupEdgeThickness; | 266 static const int kPopupEdgeThickness; |
266 // Space between items in the location bar, as well as between items and the | 267 // Space between items in the location bar, as well as between items and the |
267 // edges. | 268 // edges. |
268 static const int kItemPadding; | 269 static const int kItemPadding; |
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
329 // using an accessibility API (typically automation software, screen readers | 330 // using an accessibility API (typically automation software, screen readers |
330 // don't normally use this). Sets the value and clears the selection. | 331 // don't normally use this). Sets the value and clears the selection. |
331 void AccessibilitySetValue(const base::string16& new_value); | 332 void AccessibilitySetValue(const base::string16& new_value); |
332 | 333 |
333 // Returns true if the suggest text is valid. | 334 // Returns true if the suggest text is valid. |
334 bool HasValidSuggestText() const; | 335 bool HasValidSuggestText() const; |
335 | 336 |
336 bool ShouldShowKeywordBubble() const; | 337 bool ShouldShowKeywordBubble() const; |
337 bool ShouldShowEVBubble() const; | 338 bool ShouldShowEVBubble() const; |
338 | 339 |
339 // Origin chip animation control methods. | 340 // Used to "reverse" the URL showing/hiding animations, since we use separate |
340 void OnShowURLAnimationEnded(); | 341 // animations whose curves are not true inverses of each other. Based on the |
341 void OnHideURLAnimationEnded(); | 342 // current position of the omnibox, calculates what value the desired |
343 // animation (|hide_url_animation_| if |hide| is true, |show_url_animation_| | |
344 // if it's false) should be set to in order to produce the same omnibox | |
345 // position. This way we can stop the old animation, set the new animation to | |
346 // this value, and start it running, and the text will appear to reverse | |
347 // directions from its current location. | |
348 double GetValueForAnimation(bool hide) const; | |
Justin Donnelly
2014/05/29 21:37:29
How about GetPositionForAnimation to be more speci
Peter Kasting
2014/05/29 23:32:16
That wouldn't be correct. Because the animations
Justin Donnelly
2014/06/02 15:07:33
Ah, yeah, my bad. I made this comment before I re
| |
349 | |
350 // Resets |show_url_animation_| and the color changes it causes. | |
351 void ResetShowAnimationAndColors(); | |
342 | 352 |
343 // LocationBar: | 353 // LocationBar: |
344 virtual void ShowFirstRunBubble() OVERRIDE; | 354 virtual void ShowFirstRunBubble() OVERRIDE; |
345 virtual GURL GetDestinationURL() const OVERRIDE; | 355 virtual GURL GetDestinationURL() const OVERRIDE; |
346 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; | 356 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; |
347 virtual content::PageTransition GetPageTransition() const OVERRIDE; | 357 virtual content::PageTransition GetPageTransition() const OVERRIDE; |
348 virtual void AcceptInput() OVERRIDE; | 358 virtual void AcceptInput() OVERRIDE; |
349 virtual void FocusSearch() OVERRIDE; | 359 virtual void FocusSearch() OVERRIDE; |
350 virtual void UpdateContentSettingsIcons() OVERRIDE; | 360 virtual void UpdateContentSettingsIcons() OVERRIDE; |
351 virtual void UpdateManagePasswordsIconAndBubble() OVERRIDE; | 361 virtual void UpdateManagePasswordsIconAndBubble() OVERRIDE; |
(...skipping 155 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
507 | 517 |
508 // During dropdown animation, the host clips the widget and draws only the | 518 // During dropdown animation, the host clips the widget and draws only the |
509 // bottom part of it. The view needs to know the pixel offset at which we are | 519 // bottom part of it. The view needs to know the pixel offset at which we are |
510 // drawing the widget so that we can draw the curved edges that attach to the | 520 // drawing the widget so that we can draw the curved edges that attach to the |
511 // toolbar in the right location. | 521 // toolbar in the right location. |
512 int dropdown_animation_offset_; | 522 int dropdown_animation_offset_; |
513 | 523 |
514 // Origin chip animations. | 524 // Origin chip animations. |
515 scoped_ptr<gfx::SlideAnimation> show_url_animation_; | 525 scoped_ptr<gfx::SlideAnimation> show_url_animation_; |
516 scoped_ptr<gfx::SlideAnimation> hide_url_animation_; | 526 scoped_ptr<gfx::SlideAnimation> hide_url_animation_; |
517 | 527 int current_omnibox_offset_; |
518 // Text label shown only during origin chip animations. | 528 int starting_omnibox_offset_; |
519 views::Label* animated_host_label_; | 529 int current_omnibox_leading_inset_; |
530 int starting_omnibox_leading_inset_; | |
531 int current_omnibox_width_; | |
532 int ending_omnibox_width_; | |
520 | 533 |
521 // Used to register for notifications received by NotificationObserver. | 534 // Used to register for notifications received by NotificationObserver. |
522 content::NotificationRegistrar registrar_; | 535 content::NotificationRegistrar registrar_; |
523 | 536 |
524 // Used to bind callback functions to this object. | 537 // Used to bind callback functions to this object. |
525 base::WeakPtrFactory<LocationBarView> weak_ptr_factory_; | 538 base::WeakPtrFactory<LocationBarView> weak_ptr_factory_; |
526 | 539 |
527 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 540 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
528 }; | 541 }; |
529 | 542 |
530 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 543 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |