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_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> |
(...skipping 26 matching lines...) Expand all Loading... |
37 class ExtensionAction; | 37 class ExtensionAction; |
38 class GURL; | 38 class GURL; |
39 class InstantController; | 39 class InstantController; |
40 class KeywordHintView; | 40 class KeywordHintView; |
41 class LocationIconView; | 41 class LocationIconView; |
42 class PageActionWithBadgeView; | 42 class PageActionWithBadgeView; |
43 class Profile; | 43 class Profile; |
44 class SelectedKeywordView; | 44 class SelectedKeywordView; |
45 class StarView; | 45 class StarView; |
46 class SuggestedTextView; | 46 class SuggestedTextView; |
| 47 class TabContentsWrapper; |
47 class TemplateURLModel; | 48 class TemplateURLModel; |
48 | 49 |
49 namespace views { | 50 namespace views { |
50 class HorizontalPainter; | 51 class HorizontalPainter; |
51 class Label; | 52 class Label; |
52 }; | 53 }; |
53 | 54 |
54 ///////////////////////////////////////////////////////////////////////////// | 55 ///////////////////////////////////////////////////////////////////////////// |
55 // | 56 // |
56 // LocationBarView class | 57 // LocationBarView class |
57 // | 58 // |
58 // The LocationBarView class is a View subclass that paints the background | 59 // The LocationBarView class is a View subclass that paints the background |
59 // of the URL bar strip and contains its content. | 60 // of the URL bar strip and contains its content. |
60 // | 61 // |
61 ///////////////////////////////////////////////////////////////////////////// | 62 ///////////////////////////////////////////////////////////////////////////// |
62 class LocationBarView : public LocationBar, | 63 class LocationBarView : public LocationBar, |
63 public LocationBarTesting, | 64 public LocationBarTesting, |
64 public views::View, | 65 public views::View, |
65 public views::DragController, | 66 public views::DragController, |
66 public AutocompleteEditController, | 67 public AutocompleteEditController, |
67 public TemplateURLModelObserver { | 68 public TemplateURLModelObserver { |
68 public: | 69 public: |
69 // The location bar view's class name. | 70 // The location bar view's class name. |
70 static const char kViewClassName[]; | 71 static const char kViewClassName[]; |
71 | 72 |
72 class Delegate { | 73 class Delegate { |
73 public: | 74 public: |
74 // Should return the current tab contents. | 75 // Should return the current tab contents. |
75 virtual TabContents* GetTabContents() = 0; | 76 virtual TabContentsWrapper* GetTabContentsWrapper() = 0; |
76 | 77 |
77 // Returns the InstantController, or NULL if there isn't one. | 78 // Returns the InstantController, or NULL if there isn't one. |
78 virtual InstantController* GetInstant() = 0; | 79 virtual InstantController* GetInstant() = 0; |
79 | 80 |
80 // Called by the location bar view when the user starts typing in the edit. | 81 // Called by the location bar view when the user starts typing in the edit. |
81 // This forces our security style to be UNKNOWN for the duration of the | 82 // This forces our security style to be UNKNOWN for the duration of the |
82 // editing. | 83 // editing. |
83 virtual void OnInputInProgress(bool in_progress) = 0; | 84 virtual void OnInputInProgress(bool in_progress) = 0; |
84 }; | 85 }; |
85 | 86 |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
122 ColorKind kind); | 123 ColorKind kind); |
123 | 124 |
124 // Updates the location bar. We also reset the bar's permanent text and | 125 // Updates the location bar. We also reset the bar's permanent text and |
125 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore | 126 // security style, and, if |tab_for_state_restoring| is non-NULL, also restore |
126 // saved state that the tab holds. | 127 // saved state that the tab holds. |
127 void Update(const TabContents* tab_for_state_restoring); | 128 void Update(const TabContents* tab_for_state_restoring); |
128 | 129 |
129 void SetProfile(Profile* profile); | 130 void SetProfile(Profile* profile); |
130 Profile* profile() const { return profile_; } | 131 Profile* profile() const { return profile_; } |
131 | 132 |
132 // Returns the current TabContents. | 133 // Returns the current TabContentsWrapper. |
133 TabContents* GetTabContents() const; | 134 TabContentsWrapper* GetTabContentsWrapper() const; |
134 | 135 |
135 // Sets |preview_enabled| for the PageAction View associated with this | 136 // Sets |preview_enabled| for the PageAction View associated with this |
136 // |page_action|. If |preview_enabled| is true, the view will display the | 137 // |page_action|. If |preview_enabled| is true, the view will display the |
137 // PageActions icon even though it has not been activated by the extension. | 138 // PageActions icon even though it has not been activated by the extension. |
138 // This is used by the ExtensionInstalledBubble to preview what the icon | 139 // This is used by the ExtensionInstalledBubble to preview what the icon |
139 // will look like for the user upon installation of the extension. | 140 // will look like for the user upon installation of the extension. |
140 void SetPreviewEnabledPageAction(ExtensionAction *page_action, | 141 void SetPreviewEnabledPageAction(ExtensionAction *page_action, |
141 bool preview_enabled); | 142 bool preview_enabled); |
142 | 143 |
143 // Retrieves the PageAction View which is associated with |page_action|. | 144 // Retrieves the PageAction View which is associated with |page_action|. |
(...skipping 260 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
404 // Should instant be updated? This is set to false in OnAutocompleteWillAccept | 405 // Should instant be updated? This is set to false in OnAutocompleteWillAccept |
405 // and true in OnAutocompleteAccept. This is needed as prior to accepting an | 406 // and true in OnAutocompleteAccept. This is needed as prior to accepting an |
406 // autocomplete suggestion the model is reverted which triggers resetting | 407 // autocomplete suggestion the model is reverted which triggers resetting |
407 // instant. | 408 // instant. |
408 bool update_instant_; | 409 bool update_instant_; |
409 | 410 |
410 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); | 411 DISALLOW_IMPLICIT_CONSTRUCTORS(LocationBarView); |
411 }; | 412 }; |
412 | 413 |
413 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ | 414 #endif // CHROME_BROWSER_UI_VIEWS_LOCATION_BAR_LOCATION_BAR_VIEW_H_ |
OLD | NEW |