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