OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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_CHROMEOS_COMPACT_LOCATION_BAR_VIEW_H_ | 5 #ifndef CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_VIEW_H_ |
6 #define CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_VIEW_H_ | 6 #define CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_VIEW_H_ |
7 | 7 |
8 #include "base/basictypes.h" | 8 #include "base/basictypes.h" |
9 #include "chrome/browser/bubble_positioner.h" | |
10 #include "chrome/browser/autocomplete/autocomplete_edit.h" | 9 #include "chrome/browser/autocomplete/autocomplete_edit.h" |
11 #include "chrome/browser/chromeos/compact_location_bar_host.h" | 10 #include "chrome/browser/chromeos/compact_location_bar_host.h" |
12 #include "chrome/browser/views/dropdown_bar_view.h" | 11 #include "chrome/browser/views/dropdown_bar_view.h" |
13 #include "views/controls/button/button.h" | 12 #include "views/controls/button/button.h" |
14 #include "views/view.h" | 13 #include "views/view.h" |
15 | 14 |
16 class AutocompleteEditViewGtk; | 15 class AutocompleteEditViewGtk; |
17 class Browser; | 16 class Browser; |
18 class BrowserActionsContainer; | 17 class BrowserActionsContainer; |
19 class BrowserView; | 18 class BrowserView; |
20 class Tab; | 19 class Tab; |
21 class TabContents; | 20 class TabContents; |
22 class TabStrip; | 21 class TabStrip; |
23 | 22 |
24 namespace views { | 23 namespace views { |
25 class ImageButton; | 24 class ImageButton; |
26 class NativeViewHost; | 25 class NativeViewHost; |
27 } // namespace views | 26 } // namespace views |
28 | 27 |
29 namespace chromeos { | 28 namespace chromeos { |
30 | 29 |
31 // CompactLocationBarView is a version of location bar that is shown under | 30 // CompactLocationBarView is a version of location bar that is shown under |
32 // a tab for short priod of used when Chrome is in the compact | 31 // a tab for short priod of used when Chrome is in the compact |
33 // navigation bar mode. | 32 // navigation bar mode. |
34 class CompactLocationBarView : public DropdownBarView, | 33 class CompactLocationBarView : public DropdownBarView, |
35 public views::ButtonListener, | 34 public views::ButtonListener, |
36 public AutocompleteEditController, | 35 public AutocompleteEditController { |
37 public BubblePositioner { | |
38 public: | 36 public: |
39 explicit CompactLocationBarView(CompactLocationBarHost* host); | 37 explicit CompactLocationBarView(CompactLocationBarHost* host); |
40 ~CompactLocationBarView(); | 38 ~CompactLocationBarView(); |
41 | 39 |
42 // Claims focus for the text field and selects its contents. | 40 // Claims focus for the text field and selects its contents. |
43 virtual void SetFocusAndSelection(); | 41 virtual void SetFocusAndSelection(); |
44 | 42 |
45 void Update(const TabContents* contents); | 43 void Update(const TabContents* contents); |
46 | 44 |
47 private: | 45 private: |
(...skipping 21 matching lines...) Expand all Loading... |
69 WindowOpenDisposition disposition, | 67 WindowOpenDisposition disposition, |
70 PageTransition::Type transition, | 68 PageTransition::Type transition, |
71 const GURL& alternate_nav_url); | 69 const GURL& alternate_nav_url); |
72 virtual void OnChanged(); | 70 virtual void OnChanged(); |
73 virtual void OnKillFocus(); | 71 virtual void OnKillFocus(); |
74 virtual void OnSetFocus(); | 72 virtual void OnSetFocus(); |
75 virtual void OnInputInProgress(bool in_progress); | 73 virtual void OnInputInProgress(bool in_progress); |
76 virtual SkBitmap GetFavIcon() const; | 74 virtual SkBitmap GetFavIcon() const; |
77 virtual std::wstring GetTitle() const; | 75 virtual std::wstring GetTitle() const; |
78 | 76 |
79 // BubblePositioner implementation. | |
80 virtual gfx::Rect GetLocationStackBounds() const; | |
81 | |
82 CompactLocationBarHost* clb_host() { | 77 CompactLocationBarHost* clb_host() { |
83 return static_cast<CompactLocationBarHost*>(host()); | 78 return static_cast<CompactLocationBarHost*>(host()); |
84 } | 79 } |
85 | 80 |
86 views::ImageButton* reload_; | 81 views::ImageButton* reload_; |
87 scoped_ptr<AutocompleteEditViewGtk> location_entry_; | 82 scoped_ptr<AutocompleteEditViewGtk> location_entry_; |
88 views::NativeViewHost* location_entry_view_; | 83 views::NativeViewHost* location_entry_view_; |
89 BrowserActionsContainer* browser_actions_; | 84 BrowserActionsContainer* browser_actions_; |
90 | 85 |
91 DISALLOW_COPY_AND_ASSIGN(CompactLocationBarView); | 86 DISALLOW_COPY_AND_ASSIGN(CompactLocationBarView); |
92 }; | 87 }; |
93 | 88 |
94 } // namespace chromeos | 89 } // namespace chromeos |
95 | 90 |
96 #endif // CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_VIEW_H_ | 91 #endif // CHROME_BROWSER_CHROMEOS_COMPACT_LOCATION_BAR_VIEW_H_ |
OLD | NEW |