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_BROWSER_ACTIONS_CONTAINER_H_ | 5 #ifndef CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 6 #define CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
7 | 7 |
8 #include "chrome/browser/extensions/extension_keybinding_registry.h" | 8 #include "chrome/browser/extensions/extension_keybinding_registry.h" |
9 #include "chrome/browser/extensions/extension_toolbar_model.h" | 9 #include "chrome/browser/extensions/extension_toolbar_model.h" |
10 #include "chrome/browser/ui/views/browser_action_view.h" | 10 #include "chrome/browser/ui/views/browser_action_view.h" |
(...skipping 241 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
252 // Returns the height of an icon. | 252 // Returns the height of an icon. |
253 static int IconHeight(); | 253 static int IconHeight(); |
254 | 254 |
255 // ExtensionToolbarModel::Observer implementation. | 255 // ExtensionToolbarModel::Observer implementation. |
256 virtual void BrowserActionAdded(const extensions::Extension* extension, | 256 virtual void BrowserActionAdded(const extensions::Extension* extension, |
257 int index) OVERRIDE; | 257 int index) OVERRIDE; |
258 virtual void BrowserActionRemoved( | 258 virtual void BrowserActionRemoved( |
259 const extensions::Extension* extension) OVERRIDE; | 259 const extensions::Extension* extension) OVERRIDE; |
260 virtual void BrowserActionMoved(const extensions::Extension* extension, | 260 virtual void BrowserActionMoved(const extensions::Extension* extension, |
261 int index) OVERRIDE; | 261 int index) OVERRIDE; |
262 virtual bool BrowserActionShowPopup( | |
263 const extensions::Extension* extension) OVERRIDE; | |
262 virtual void ModelLoaded() OVERRIDE; | 264 virtual void ModelLoaded() OVERRIDE; |
263 | 265 |
264 void LoadImages(); | 266 void LoadImages(); |
265 | 267 |
266 // Sets the initial container width. | 268 // Sets the initial container width. |
267 void SetContainerWidth(); | 269 void SetContainerWidth(); |
268 | 270 |
269 // Closes the overflow menu if open. | 271 // Closes the overflow menu if open. |
270 void CloseOverflowMenu(); | 272 void CloseOverflowMenu(); |
271 | 273 |
(...skipping 30 matching lines...) Expand all Loading... | |
302 // the target size). This also saves the target number of visible icons in | 304 // the target size). This also saves the target number of visible icons in |
303 // the pref if we're not incognito. | 305 // the pref if we're not incognito. |
304 void SaveDesiredSizeAndAnimate(gfx::Tween::Type type, | 306 void SaveDesiredSizeAndAnimate(gfx::Tween::Type type, |
305 size_t num_visible_icons); | 307 size_t num_visible_icons); |
306 | 308 |
307 // Returns true if this extension should be shown in this toolbar. This can | 309 // Returns true if this extension should be shown in this toolbar. This can |
308 // return false if we are in an incognito window and the extension is disabled | 310 // return false if we are in an incognito window and the extension is disabled |
309 // for incognito. | 311 // for incognito. |
310 bool ShouldDisplayBrowserAction(const extensions::Extension* extension); | 312 bool ShouldDisplayBrowserAction(const extensions::Extension* extension); |
311 | 313 |
312 // Show a popup. | 314 // Show a popup. Returns true if a new popup was shown. |
313 void ShowPopup(BrowserActionButton* button, | 315 bool ShowPopup(BrowserActionButton* button, |
316 ExtensionPopup::ShowAction show_action, | |
317 bool should_grant); | |
Finnur
2013/10/17 14:58:34
Same argument here (one function or two similar fu
justinlin
2013/10/17 18:32:53
Done.
| |
318 bool ShowPopup(BrowserActionButton* button, | |
314 ExtensionPopup::ShowAction show_action); | 319 ExtensionPopup::ShowAction show_action); |
315 | 320 |
316 // The vector of browser actions (icons/image buttons for each action). Note | 321 // The vector of browser actions (icons/image buttons for each action). Note |
317 // that not every BrowserAction in the ToolbarModel will necessarily be in | 322 // that not every BrowserAction in the ToolbarModel will necessarily be in |
318 // this collection. Some extensions may be disabled in incognito windows. | 323 // this collection. Some extensions may be disabled in incognito windows. |
319 BrowserActionViews browser_action_views_; | 324 BrowserActionViews browser_action_views_; |
320 | 325 |
321 Profile* profile_; | 326 Profile* profile_; |
322 | 327 |
323 // The Browser object the container is associated with. | 328 // The Browser object the container is associated with. |
(...skipping 48 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
372 | 377 |
373 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; | 378 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; |
374 | 379 |
375 // Handles delayed showing of the overflow menu when hovering. | 380 // Handles delayed showing of the overflow menu when hovering. |
376 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; | 381 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; |
377 | 382 |
378 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 383 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
379 }; | 384 }; |
380 | 385 |
381 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 386 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
OLD | NEW |