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/pref_member.h" | 12 #include "base/prefs/pref_member.h" |
13 #include "chrome/browser/extensions/extension_context_menu_model.h" | 13 #include "chrome/browser/extensions/extension_context_menu_model.h" |
14 #include "chrome/browser/ui/location_bar/location_bar.h" | 14 #include "chrome/browser/ui/location_bar/location_bar.h" |
15 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" | 15 #include "chrome/browser/ui/omnibox/omnibox_edit_controller.h" |
16 #include "chrome/browser/ui/search/search_model_observer.h" | 16 #include "chrome/browser/ui/search/search_model_observer.h" |
17 #include "chrome/browser/ui/toolbar/toolbar_model.h" | 17 #include "chrome/browser/ui/toolbar/toolbar_model.h" |
18 #include "chrome/browser/ui/views/dropdown_bar_host.h" | 18 #include "chrome/browser/ui/views/dropdown_bar_host.h" |
19 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" | 19 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" |
20 #include "chrome/browser/ui/views/extensions/extension_popup.h" | 20 #include "chrome/browser/ui/views/extensions/extension_popup.h" |
21 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" | 21 #include "chrome/browser/ui/views/omnibox/omnibox_view_views.h" |
22 #include "components/search_engines/template_url_service_observer.h" | 22 #include "components/search_engines/template_url_service_observer.h" |
23 #include "content/public/browser/notification_observer.h" | |
24 #include "content/public/browser/notification_registrar.h" | |
25 #include "ui/gfx/animation/animation_delegate.h" | 23 #include "ui/gfx/animation/animation_delegate.h" |
26 #include "ui/gfx/font.h" | 24 #include "ui/gfx/font.h" |
27 #include "ui/gfx/rect.h" | 25 #include "ui/gfx/rect.h" |
28 #include "ui/views/controls/button/button.h" | 26 #include "ui/views/controls/button/button.h" |
29 #include "ui/views/drag_controller.h" | 27 #include "ui/views/drag_controller.h" |
30 | 28 |
31 class ActionBoxButtonView; | 29 class ActionBoxButtonView; |
32 class CommandUpdater; | 30 class CommandUpdater; |
33 class ContentSettingBubbleModelDelegate; | 31 class ContentSettingBubbleModelDelegate; |
34 class ContentSettingImageView; | 32 class ContentSettingImageView; |
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
78 ///////////////////////////////////////////////////////////////////////////// | 76 ///////////////////////////////////////////////////////////////////////////// |
79 class LocationBarView : public LocationBar, | 77 class LocationBarView : public LocationBar, |
80 public LocationBarTesting, | 78 public LocationBarTesting, |
81 public views::View, | 79 public views::View, |
82 public views::ButtonListener, | 80 public views::ButtonListener, |
83 public views::DragController, | 81 public views::DragController, |
84 public OmniboxEditController, | 82 public OmniboxEditController, |
85 public DropdownBarHostDelegate, | 83 public DropdownBarHostDelegate, |
86 public gfx::AnimationDelegate, | 84 public gfx::AnimationDelegate, |
87 public TemplateURLServiceObserver, | 85 public TemplateURLServiceObserver, |
88 public content::NotificationObserver, | |
89 public SearchModelObserver { | 86 public SearchModelObserver { |
90 public: | 87 public: |
91 // The location bar view's class name. | 88 // The location bar view's class name. |
92 static const char kViewClassName[]; | 89 static const char kViewClassName[]; |
93 | 90 |
94 // Returns the offset used during dropdown animation. | 91 // Returns the offset used during dropdown animation. |
95 int dropdown_animation_offset() const { return dropdown_animation_offset_; } | 92 int dropdown_animation_offset() const { return dropdown_animation_offset_; } |
96 | 93 |
97 class Delegate { | 94 class Delegate { |
98 public: | 95 public: |
(...skipping 300 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; | 396 virtual void SetFocusAndSelection(bool select_all) OVERRIDE; |
400 virtual void SetAnimationOffset(int offset) OVERRIDE; | 397 virtual void SetAnimationOffset(int offset) OVERRIDE; |
401 | 398 |
402 // gfx::AnimationDelegate: | 399 // gfx::AnimationDelegate: |
403 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; | 400 virtual void AnimationProgressed(const gfx::Animation* animation) OVERRIDE; |
404 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; | 401 virtual void AnimationEnded(const gfx::Animation* animation) OVERRIDE; |
405 | 402 |
406 // TemplateURLServiceObserver: | 403 // TemplateURLServiceObserver: |
407 virtual void OnTemplateURLServiceChanged() OVERRIDE; | 404 virtual void OnTemplateURLServiceChanged() OVERRIDE; |
408 | 405 |
409 // content::NotificationObserver: | |
410 virtual void Observe(int type, | |
411 const content::NotificationSource& source, | |
412 const content::NotificationDetails& details) OVERRIDE; | |
413 | |
414 // SearchModelObserver: | 406 // SearchModelObserver: |
415 virtual void ModelChanged(const SearchModel::State& old_state, | 407 virtual void ModelChanged(const SearchModel::State& old_state, |
416 const SearchModel::State& new_state) OVERRIDE; | 408 const SearchModel::State& new_state) OVERRIDE; |
417 | 409 |
418 // The Browser this LocationBarView is in. Note that at least | 410 // The Browser this LocationBarView is in. Note that at least |
419 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser | 411 // chromeos::SimpleWebViewDialog uses a LocationBarView outside any browser |
420 // window, so this may be NULL. | 412 // window, so this may be NULL. |
421 Browser* browser_; | 413 Browser* browser_; |
422 | 414 |
423 OmniboxViewViews* omnibox_view_; | 415 OmniboxViewViews* omnibox_view_; |
(...skipping 122 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
546 // the hostname. As the show animation runs, the current inset gradually | 538 // the hostname. As the show animation runs, the current inset gradually |
547 // moves to 0. | 539 // moves to 0. |
548 int starting_omnibox_leading_inset_; | 540 int starting_omnibox_leading_inset_; |
549 int current_omnibox_leading_inset_; | 541 int current_omnibox_leading_inset_; |
550 // The width is always positive. The ending width is the width of the entire | 542 // The width is always positive. The ending width is the width of the entire |
551 // omnibox URL. As the show animation runs, the current width gradually moves | 543 // omnibox URL. As the show animation runs, the current width gradually moves |
552 // from the width of the hostname to the ending value. | 544 // from the width of the hostname to the ending value. |
553 int current_omnibox_width_; | 545 int current_omnibox_width_; |
554 int ending_omnibox_width_; | 546 int ending_omnibox_width_; |
555 | 547 |
556 // Used to register for notifications received by NotificationObserver. | |
557 content::NotificationRegistrar registrar_; | |
558 | |
559 DISALLOW_COPY_AND_ASSIGN(LocationBarView); | 548 DISALLOW_COPY_AND_ASSIGN(LocationBarView); |
560 }; | 549 }; |
561 | 550 |
562 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 551 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |