| 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 |
| 11 #include "base/compiler_specific.h" | 11 #include "base/compiler_specific.h" |
| 12 #include "base/prefs/public/pref_observer.h" | |
| 13 #include "chrome/browser/api/prefs/pref_member.h" | 12 #include "chrome/browser/api/prefs/pref_member.h" |
| 14 #include "chrome/browser/extensions/extension_context_menu_model.h" | 13 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 15 #include "chrome/browser/search_engines/template_url_service_observer.h" | 14 #include "chrome/browser/search_engines/template_url_service_observer.h" |
| 16 #include "chrome/browser/ui/omnibox/location_bar.h" | 15 #include "chrome/browser/ui/omnibox/location_bar.h" |
| 17 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 16 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
| 18 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 17 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
| 19 #include "chrome/browser/ui/views/dropdown_bar_host.h" | 18 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
| 20 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" | 19 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" |
| 21 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 20 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
| 22 #include "content/public/browser/notification_observer.h" | 21 #include "content/public/browser/notification_observer.h" |
| (...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 // of the URL bar strip and contains its content. | 63 // of the URL bar strip and contains its content. |
| 65 // | 64 // |
| 66 ///////////////////////////////////////////////////////////////////////////// | 65 ///////////////////////////////////////////////////////////////////////////// |
| 67 class LocationBarView : public LocationBar, | 66 class LocationBarView : public LocationBar, |
| 68 public LocationBarTesting, | 67 public LocationBarTesting, |
| 69 public views::View, | 68 public views::View, |
| 70 public views::DragController, | 69 public views::DragController, |
| 71 public OmniboxEditController, | 70 public OmniboxEditController, |
| 72 public DropdownBarHostDelegate, | 71 public DropdownBarHostDelegate, |
| 73 public TemplateURLServiceObserver, | 72 public TemplateURLServiceObserver, |
| 74 public content::NotificationObserver, | 73 public content::NotificationObserver { |
| 75 public PrefObserver { | |
| 76 public: | 74 public: |
| 77 // The location bar view's class name. | 75 // The location bar view's class name. |
| 78 static const char kViewClassName[]; | 76 static const char kViewClassName[]; |
| 79 | 77 |
| 80 // DropdownBarHostDelegate | 78 // DropdownBarHostDelegate |
| 81 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; | 79 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; |
| 82 virtual void SetAnimationOffset(int offset) OVERRIDE; | 80 virtual void SetAnimationOffset(int offset) OVERRIDE; |
| 83 | 81 |
| 84 // Returns the offset used while animating. | 82 // Returns the offset used while animating. |
| 85 int animation_offset() const { return animation_offset_; } | 83 int animation_offset() const { return animation_offset_; } |
| (...skipping 228 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 314 virtual bool GetBookmarkStarVisibility() OVERRIDE; | 312 virtual bool GetBookmarkStarVisibility() OVERRIDE; |
| 315 | 313 |
| 316 // Overridden from TemplateURLServiceObserver | 314 // Overridden from TemplateURLServiceObserver |
| 317 virtual void OnTemplateURLServiceChanged() OVERRIDE; | 315 virtual void OnTemplateURLServiceChanged() OVERRIDE; |
| 318 | 316 |
| 319 // Overridden from content::NotificationObserver | 317 // Overridden from content::NotificationObserver |
| 320 virtual void Observe(int type, | 318 virtual void Observe(int type, |
| 321 const content::NotificationSource& source, | 319 const content::NotificationSource& source, |
| 322 const content::NotificationDetails& details) OVERRIDE; | 320 const content::NotificationDetails& details) OVERRIDE; |
| 323 | 321 |
| 324 // Overridden from PrefObserver | |
| 325 virtual void OnPreferenceChanged(PrefServiceBase* service, | |
| 326 const std::string& pref_name) OVERRIDE; | |
| 327 | |
| 328 // Returns the height of the control without the top and bottom | 322 // Returns the height of the control without the top and bottom |
| 329 // edges(i.e. the height of the edit control inside). If | 323 // edges(i.e. the height of the edit control inside). If |
| 330 // |use_preferred_size| is true this will be the preferred height, | 324 // |use_preferred_size| is true this will be the preferred height, |
| 331 // otherwise it will be the current height. | 325 // otherwise it will be the current height. |
| 332 int GetInternalHeight(bool use_preferred_size); | 326 int GetInternalHeight(bool use_preferred_size); |
| 333 | 327 |
| 334 // Space between items in the location bar. | 328 // Space between items in the location bar. |
| 335 static int GetItemPadding(); | 329 static int GetItemPadding(); |
| 336 | 330 |
| 337 // Space between the edges and the items next to them. | 331 // Space between the edges and the items next to them. |
| (...skipping 171 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 // in the right location. | 503 // in the right location. |
| 510 int animation_offset_; | 504 int animation_offset_; |
| 511 | 505 |
| 512 // Used to register for notifications received by NotificationObserver. | 506 // Used to register for notifications received by NotificationObserver. |
| 513 content::NotificationRegistrar registrar_; | 507 content::NotificationRegistrar registrar_; |
| 514 | 508 |
| 515 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); | 509 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); |
| 516 }; | 510 }; |
| 517 | 511 |
| 518 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 512 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
| OLD | NEW |