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 60 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
71 public views::DragController, | 71 public views::DragController, |
72 public gfx::AnimationDelegate, | 72 public gfx::AnimationDelegate, |
73 public ChromeOmniboxEditController, | 73 public ChromeOmniboxEditController, |
74 public DropdownBarHostDelegate, | 74 public DropdownBarHostDelegate, |
75 public TemplateURLServiceObserver, | 75 public TemplateURLServiceObserver, |
76 public ui_zoom::ZoomEventManagerObserver { | 76 public ui_zoom::ZoomEventManagerObserver { |
77 public: | 77 public: |
78 // The location bar view's class name. | 78 // The location bar view's class name. |
79 static const char kViewClassName[]; | 79 static const char kViewClassName[]; |
80 | 80 |
| 81 // Returns the offset used during dropdown animation. |
| 82 int dropdown_animation_offset() const { return dropdown_animation_offset_; } |
| 83 |
81 class Delegate { | 84 class Delegate { |
82 public: | 85 public: |
83 // Should return the current web contents. | 86 // Should return the current web contents. |
84 virtual content::WebContents* GetWebContents() = 0; | 87 virtual content::WebContents* GetWebContents() = 0; |
85 | 88 |
86 virtual ToolbarModel* GetToolbarModel() = 0; | 89 virtual ToolbarModel* GetToolbarModel() = 0; |
87 virtual const ToolbarModel* GetToolbarModel() const = 0; | 90 virtual const ToolbarModel* GetToolbarModel() const = 0; |
88 | 91 |
89 // Creates Widget for the given delegate. | 92 // Creates Widget for the given delegate. |
90 virtual views::Widget* CreateViewsBubble( | 93 virtual views::Widget* CreateViewsBubble( |
(...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
378 void AnimationProgressed(const gfx::Animation* animation) override; | 381 void AnimationProgressed(const gfx::Animation* animation) override; |
379 void AnimationEnded(const gfx::Animation* animation) override; | 382 void AnimationEnded(const gfx::Animation* animation) override; |
380 | 383 |
381 // ChromeOmniboxEditController: | 384 // ChromeOmniboxEditController: |
382 void OnChanged() override; | 385 void OnChanged() override; |
383 void OnSetFocus() override; | 386 void OnSetFocus() override; |
384 const ToolbarModel* GetToolbarModel() const override; | 387 const ToolbarModel* GetToolbarModel() const override; |
385 | 388 |
386 // DropdownBarHostDelegate: | 389 // DropdownBarHostDelegate: |
387 void SetFocusAndSelection(bool select_all) override; | 390 void SetFocusAndSelection(bool select_all) override; |
| 391 void SetAnimationOffset(int offset) override; |
388 | 392 |
389 // TemplateURLServiceObserver: | 393 // TemplateURLServiceObserver: |
390 void OnTemplateURLServiceChanged() override; | 394 void OnTemplateURLServiceChanged() override; |
391 | 395 |
392 // The Browser this LocationBarView is in. Note that at least | 396 // The Browser this LocationBarView is in. Note that at least |
393 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 397 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
394 // window, so this may be NULL. | 398 // window, so this may be NULL. |
395 Browser* browser_; | 399 Browser* browser_; |
396 | 400 |
397 OmniboxViewViews* omnibox_view_; | 401 OmniboxViewViews* omnibox_view_; |
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
463 // focused. Used when the toolbar is in full keyboard accessibility mode. | 467 // focused. Used when the toolbar is in full keyboard accessibility mode. |
464 bool show_focus_rect_; | 468 bool show_focus_rect_; |
465 | 469 |
466 // This is in case we're destroyed before the model loads. We need to make | 470 // This is in case we're destroyed before the model loads. We need to make |
467 // Add/RemoveObserver calls. | 471 // Add/RemoveObserver calls. |
468 TemplateURLService* template_url_service_; | 472 TemplateURLService* template_url_service_; |
469 | 473 |
470 // Tracks this preference to determine whether bookmark editing is allowed. | 474 // Tracks this preference to determine whether bookmark editing is allowed. |
471 BooleanPrefMember edit_bookmarks_enabled_; | 475 BooleanPrefMember edit_bookmarks_enabled_; |
472 | 476 |
| 477 // During dropdown animation, the host clips the widget and draws only the |
| 478 // bottom part of it. The view needs to know the pixel offset at which we are |
| 479 // drawing the widget so that we can draw the curved edges that attach to the |
| 480 // toolbar in the right location. |
| 481 int dropdown_animation_offset_; |
| 482 |
473 // This is a debug state variable that stores if the WebContents was null | 483 // This is a debug state variable that stores if the WebContents was null |
474 // during the last RefreshPageAction. | 484 // during the last RefreshPageAction. |
475 bool web_contents_null_at_last_refresh_; | 485 bool web_contents_null_at_last_refresh_; |
476 | 486 |
477 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 487 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
478 }; | 488 }; |
479 | 489 |
480 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 490 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |