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_GTK_LOCATION_BAR_VIEW_GTK_H_ | 5 #ifndef CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 6 #define CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <gtk/gtk.h> | 9 #include <gtk/gtk.h> |
10 | 10 |
(...skipping 119 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
130 // Implement the LocationBarTesting interface. | 130 // Implement the LocationBarTesting interface. |
131 virtual int PageActionCount() OVERRIDE; | 131 virtual int PageActionCount() OVERRIDE; |
132 virtual int PageActionVisibleCount() OVERRIDE; | 132 virtual int PageActionVisibleCount() OVERRIDE; |
133 virtual ExtensionAction* GetPageAction(size_t index) OVERRIDE; | 133 virtual ExtensionAction* GetPageAction(size_t index) OVERRIDE; |
134 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; | 134 virtual ExtensionAction* GetVisiblePageAction(size_t index) OVERRIDE; |
135 virtual void TestPageActionPressed(size_t index) OVERRIDE; | 135 virtual void TestPageActionPressed(size_t index) OVERRIDE; |
136 | 136 |
137 // Implement the content::NotificationObserver interface. | 137 // Implement the content::NotificationObserver interface. |
138 virtual void Observe(int type, | 138 virtual void Observe(int type, |
139 const content::NotificationSource& source, | 139 const content::NotificationSource& source, |
140 const content::NotificationDetails& details); | 140 const content::NotificationDetails& details) OVERRIDE; |
141 | 141 |
142 // Edit background color. | 142 // Edit background color. |
143 static const GdkColor kBackgroundColor; | 143 static const GdkColor kBackgroundColor; |
144 | 144 |
145 private: | 145 private: |
146 class ContentSettingImageViewGtk : public BubbleDelegateGtk, | 146 class ContentSettingImageViewGtk : public BubbleDelegateGtk, |
147 public ui::AnimationDelegate { | 147 public ui::AnimationDelegate { |
148 public: | 148 public: |
149 ContentSettingImageViewGtk(ContentSettingsType content_type, | 149 ContentSettingImageViewGtk(ContentSettingsType content_type, |
150 const LocationBarViewGtk* parent); | 150 const LocationBarViewGtk* parent); |
151 virtual ~ContentSettingImageViewGtk(); | 151 virtual ~ContentSettingImageViewGtk(); |
152 | 152 |
153 GtkWidget* widget() { return alignment_.get(); } | 153 GtkWidget* widget() { return alignment_.get(); } |
154 | 154 |
155 bool IsVisible(); | 155 bool IsVisible(); |
156 void UpdateFromTabContents(TabContents* tab_contents); | 156 void UpdateFromTabContents(TabContents* tab_contents); |
157 | 157 |
158 // Overridden from ui::AnimationDelegate: | 158 // Overridden from ui::AnimationDelegate: |
159 virtual void AnimationProgressed(const ui::Animation* animation); | 159 virtual void AnimationProgressed(const ui::Animation* animation) OVERRIDE; |
160 virtual void AnimationEnded(const ui::Animation* animation); | 160 virtual void AnimationEnded(const ui::Animation* animation) OVERRIDE; |
161 virtual void AnimationCanceled(const ui::Animation* animation); | 161 virtual void AnimationCanceled(const ui::Animation* animation) OVERRIDE; |
162 | 162 |
163 private: | 163 private: |
164 // Start the process of showing the label. | 164 // Start the process of showing the label. |
165 void StartAnimating(); | 165 void StartAnimating(); |
166 | 166 |
167 // Slide the label shut. | 167 // Slide the label shut. |
168 void CloseAnimation(); | 168 void CloseAnimation(); |
169 | 169 |
170 CHROMEGTK_CALLBACK_1(ContentSettingImageViewGtk, gboolean, OnButtonPressed, | 170 CHROMEGTK_CALLBACK_1(ContentSettingImageViewGtk, gboolean, OnButtonPressed, |
171 GdkEvent*); | 171 GdkEvent*); |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
220 | 220 |
221 bool IsVisible(); | 221 bool IsVisible(); |
222 | 222 |
223 // Called to notify the PageAction that it should determine whether to be | 223 // Called to notify the PageAction that it should determine whether to be |
224 // visible or hidden. |contents| is the TabContents that is active, |url| | 224 // visible or hidden. |contents| is the TabContents that is active, |url| |
225 // is the current page URL. | 225 // is the current page URL. |
226 void UpdateVisibility(TabContents* contents, const GURL& url); | 226 void UpdateVisibility(TabContents* contents, const GURL& url); |
227 | 227 |
228 // A callback from ImageLoadingTracker for when the image has loaded. | 228 // A callback from ImageLoadingTracker for when the image has loaded. |
229 virtual void OnImageLoaded( | 229 virtual void OnImageLoaded( |
230 SkBitmap* image, const ExtensionResource& resource, int index); | 230 SkBitmap* image, const ExtensionResource& resource, int index) OVERRIDE; |
231 | 231 |
232 // Simulate left mouse click on the page action button. | 232 // Simulate left mouse click on the page action button. |
233 void TestActivatePageAction(); | 233 void TestActivatePageAction(); |
234 | 234 |
235 // Overridden from ExtensionContextMenuModel::PopupDelegate: | 235 // Overridden from ExtensionContextMenuModel::PopupDelegate: |
236 virtual void InspectPopup(ExtensionAction* action); | 236 virtual void InspectPopup(ExtensionAction* action) OVERRIDE; |
237 | 237 |
238 private: | 238 private: |
239 // Show the popup for this page action. If |devtools| is true, show it | 239 // Show the popup for this page action. If |devtools| is true, show it |
240 // with a debugger window attached. Returns true if a popup was shown. | 240 // with a debugger window attached. Returns true if a popup was shown. |
241 bool ShowPopup(bool devtools); | 241 bool ShowPopup(bool devtools); |
242 | 242 |
243 CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnButtonPressed, | 243 CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnButtonPressed, |
244 GdkEventButton*); | 244 GdkEventButton*); |
245 CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnExposeEvent, | 245 CHROMEGTK_CALLBACK_1(PageActionViewGtk, gboolean, OnExposeEvent, |
246 GdkEventExpose*); | 246 GdkEventExpose*); |
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
440 // The last search keyword that was shown via the |tab_to_search_box_|. | 440 // The last search keyword that was shown via the |tab_to_search_box_|. |
441 string16 last_keyword_; | 441 string16 last_keyword_; |
442 | 442 |
443 // Used to change the visibility of the star decoration. | 443 // Used to change the visibility of the star decoration. |
444 BooleanPrefMember edit_bookmarks_enabled_; | 444 BooleanPrefMember edit_bookmarks_enabled_; |
445 | 445 |
446 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); | 446 DISALLOW_COPY_AND_ASSIGN(LocationBarViewGtk); |
447 }; | 447 }; |
448 | 448 |
449 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ | 449 #endif // CHROME_BROWSER_UI_GTK_LOCATION_BAR_VIEW_GTK_H_ |
OLD | NEW |