| 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 | |
| 84 class Delegate { | 81 class Delegate { |
| 85 public: | 82 public: |
| 86 // Should return the current web contents. | 83 // Should return the current web contents. |
| 87 virtual content::WebContents* GetWebContents() = 0; | 84 virtual content::WebContents* GetWebContents() = 0; |
| 88 | 85 |
| 89 virtual ToolbarModel* GetToolbarModel() = 0; | 86 virtual ToolbarModel* GetToolbarModel() = 0; |
| 90 virtual const ToolbarModel* GetToolbarModel() const = 0; | 87 virtual const ToolbarModel* GetToolbarModel() const = 0; |
| 91 | 88 |
| 92 // Creates Widget for the given delegate. | 89 // Creates Widget for the given delegate. |
| 93 virtual views::Widget* CreateViewsBubble( | 90 virtual views::Widget* CreateViewsBubble( |
| (...skipping 287 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 381 void AnimationProgressed(const gfx::Animation* animation) override; | 378 void AnimationProgressed(const gfx::Animation* animation) override; |
| 382 void AnimationEnded(const gfx::Animation* animation) override; | 379 void AnimationEnded(const gfx::Animation* animation) override; |
| 383 | 380 |
| 384 // ChromeOmniboxEditController: | 381 // ChromeOmniboxEditController: |
| 385 void OnChanged() override; | 382 void OnChanged() override; |
| 386 void OnSetFocus() override; | 383 void OnSetFocus() override; |
| 387 const ToolbarModel* GetToolbarModel() const override; | 384 const ToolbarModel* GetToolbarModel() const override; |
| 388 | 385 |
| 389 // DropdownBarHostDelegate: | 386 // DropdownBarHostDelegate: |
| 390 void SetFocusAndSelection(bool select_all) override; | 387 void SetFocusAndSelection(bool select_all) override; |
| 391 void SetAnimationOffset(int offset) override; | |
| 392 | 388 |
| 393 // TemplateURLServiceObserver: | 389 // TemplateURLServiceObserver: |
| 394 void OnTemplateURLServiceChanged() override; | 390 void OnTemplateURLServiceChanged() override; |
| 395 | 391 |
| 396 // The Browser this LocationBarView is in. Note that at least | 392 // The Browser this LocationBarView is in. Note that at least |
| 397 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 393 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
| 398 // window, so this may be NULL. | 394 // window, so this may be NULL. |
| 399 Browser* browser_; | 395 Browser* browser_; |
| 400 | 396 |
| 401 OmniboxViewViews* omnibox_view_; | 397 OmniboxViewViews* omnibox_view_; |
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 467 // focused. Used when the toolbar is in full keyboard accessibility mode. | 463 // focused. Used when the toolbar is in full keyboard accessibility mode. |
| 468 bool show_focus_rect_; | 464 bool show_focus_rect_; |
| 469 | 465 |
| 470 // This is in case we're destroyed before the model loads. We need to make | 466 // This is in case we're destroyed before the model loads. We need to make |
| 471 // Add/RemoveObserver calls. | 467 // Add/RemoveObserver calls. |
| 472 TemplateURLService* template_url_service_; | 468 TemplateURLService* template_url_service_; |
| 473 | 469 |
| 474 // Tracks this preference to determine whether bookmark editing is allowed. | 470 // Tracks this preference to determine whether bookmark editing is allowed. |
| 475 BooleanPrefMember edit_bookmarks_enabled_; | 471 BooleanPrefMember edit_bookmarks_enabled_; |
| 476 | 472 |
| 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 | |
| 483 // This is a debug state variable that stores if the WebContents was null | 473 // This is a debug state variable that stores if the WebContents was null |
| 484 // during the last RefreshPageAction. | 474 // during the last RefreshPageAction. |
| 485 bool web_contents_null_at_last_refresh_; | 475 bool web_contents_null_at_last_refresh_; |
| 486 | 476 |
| 487 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 477 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
| 488 }; | 478 }; |
| 489 | 479 |
| 490 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 480 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |