| OLD | NEW |
| 1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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 #pragma once | 7 #pragma once |
| 8 | 8 |
| 9 #include <string> | 9 #include <string> |
| 10 #include <vector> | 10 #include <vector> |
| 11 | 11 |
| 12 #include "base/compiler_specific.h" | 12 #include "base/compiler_specific.h" |
| 13 #include "base/task.h" | 13 #include "base/task.h" |
| 14 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 14 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
| 15 #include "chrome/browser/extensions/extension_context_menu_model.h" | 15 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 16 #include "chrome/browser/first_run/first_run.h" | 16 #include "chrome/browser/first_run/first_run.h" |
| 17 #include "chrome/browser/prefs/pref_member.h" | 17 #include "chrome/browser/prefs/pref_member.h" |
| 18 #include "chrome/browser/search_engines/template_url_model_observer.h" | 18 #include "chrome/browser/search_engines/template_url_model_observer.h" |
| 19 #include "chrome/browser/ui/omnibox/location_bar.h" | 19 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 20 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 20 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 21 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
| 22 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" |
| 21 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 23 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| 22 #include "ui/gfx/font.h" | 24 #include "ui/gfx/font.h" |
| 23 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
| 24 #include "views/controls/native/native_view_host.h" | 26 #include "views/controls/native/native_view_host.h" |
| 25 | 27 |
| 26 #if defined(OS_WIN) | 28 #if defined(OS_WIN) |
| 27 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" | 29 #include "chrome/browser/ui/views/omnibox/omnibox_view_win.h" |
| 28 #elif defined(TOOLKIT_USES_GTK) | 30 #elif defined(TOOLKIT_USES_GTK) |
| 29 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" | 31 #include "chrome/browser/ui/gtk/omnibox/omnibox_view_gtk.h" |
| 30 #endif | 32 #endif |
| (...skipping 10 matching lines...) Expand all Loading... |
| 41 class Profile; | 43 class Profile; |
| 42 class SelectedKeywordView; | 44 class SelectedKeywordView; |
| 43 class StarView; | 45 class StarView; |
| 44 class TabContents; | 46 class TabContents; |
| 45 class TabContentsWrapper; | 47 class TabContentsWrapper; |
| 46 class TemplateURLModel; | 48 class TemplateURLModel; |
| 47 | 49 |
| 48 namespace views { | 50 namespace views { |
| 49 class HorizontalPainter; | 51 class HorizontalPainter; |
| 50 class Label; | 52 class Label; |
| 51 }; | 53 } // namespace views |
| 52 | 54 |
| 53 #if defined(OS_WIN) | 55 #if defined(OS_WIN) |
| 54 class SuggestedTextView; | 56 class SuggestedTextView; |
| 55 #endif | 57 #endif |
| 56 | 58 |
| 57 ///////////////////////////////////////////////////////////////////////////// | 59 ///////////////////////////////////////////////////////////////////////////// |
| 58 // | 60 // |
| 59 // LocationBarView class | 61 // LocationBarView class |
| 60 // | 62 // |
| 61 // The LocationBarView class is a View subclass that paints the background | 63 // The LocationBarView class is a View subclass that paints the background |
| 62 // of the URL bar strip and contains its content. | 64 // of the URL bar strip and contains its content. |
| 63 // | 65 // |
| 64 ///////////////////////////////////////////////////////////////////////////// | 66 ///////////////////////////////////////////////////////////////////////////// |
| 65 class LocationBarView : public LocationBar, | 67 class LocationBarView : public LocationBar, |
| 66 public LocationBarTesting, | 68 public LocationBarTesting, |
| 67 public views::View, | 69 public views::View, |
| 68 public views::DragController, | 70 public views::DragController, |
| 69 public AutocompleteEditController, | 71 public AutocompleteEditController, |
| 72 public DropdownBarHostDelegate, |
| 70 public TemplateURLModelObserver, | 73 public TemplateURLModelObserver, |
| 71 public NotificationObserver { | 74 public NotificationObserver { |
| 72 public: | 75 public: |
| 73 // The location bar view's class name. | 76 // The location bar view's class name. |
| 74 static const char kViewClassName[]; | 77 static const char kViewClassName[]; |
| 75 | 78 |
| 79 // DropdownBarHostDelegate |
| 80 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; |
| 81 virtual void SetAnimationOffset(int offset) OVERRIDE; |
| 82 |
| 83 // Returns the offset used while animating. |
| 84 int animation_offset() const { return animation_offset_; } |
| 85 |
| 76 class Delegate { | 86 class Delegate { |
| 77 public: | 87 public: |
| 78 // Should return the current tab contents. | 88 // Should return the current tab contents. |
| 79 virtual TabContentsWrapper* GetTabContentsWrapper() const = 0; | 89 virtual TabContentsWrapper* GetTabContentsWrapper() const = 0; |
| 80 | 90 |
| 81 // Returns the InstantController, or NULL if there isn't one. | 91 // Returns the InstantController, or NULL if there isn't one. |
| 82 virtual InstantController* GetInstant() = 0; | 92 virtual InstantController* GetInstant() = 0; |
| 83 | 93 |
| 84 // Called by the location bar view when the user starts typing in the edit. | 94 // Called by the location bar view when the user starts typing in the edit. |
| 85 // This forces our security style to be UNKNOWN for the duration of the | 95 // This forces our security style to be UNKNOWN for the duration of the |
| (...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 405 FirstRun::BubbleType bubble_type_; | 415 FirstRun::BubbleType bubble_type_; |
| 406 | 416 |
| 407 // This is in case we're destroyed before the model loads. We store the model | 417 // This is in case we're destroyed before the model loads. We store the model |
| 408 // because calling profile_->GetTemplateURLModel() in the destructor causes a | 418 // because calling profile_->GetTemplateURLModel() in the destructor causes a |
| 409 // crash. | 419 // crash. |
| 410 TemplateURLModel* template_url_model_; | 420 TemplateURLModel* template_url_model_; |
| 411 | 421 |
| 412 // Tracks this preference to determine whether bookmark editing is allowed. | 422 // Tracks this preference to determine whether bookmark editing is allowed. |
| 413 BooleanPrefMember edit_bookmarks_enabled_; | 423 BooleanPrefMember edit_bookmarks_enabled_; |
| 414 | 424 |
| 425 // While animating, the host clips the widget and draws only the bottom |
| 426 // part of it. The view needs to know the pixel offset at which we are drawing |
| 427 // the widget so that we can draw the curved edges that attach to the toolbar |
| 428 // in the right location. |
| 429 int animation_offset_; |
| 430 |
| 415 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); | 431 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); |
| 416 }; | 432 }; |
| 417 | 433 |
| 418 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 434 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |