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...) 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...) 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, |
314 ExtensionPopup::ShowAction show_action); | 316 ExtensionPopup::ShowAction show_action, |
317 bool should_grant); | |
Finnur
2013/10/18 10:31:01
Same here -- document should_grant. And while you
justinlin
2013/10/19 06:01:48
Old patch set as well. Hmm.. I don't completely un
| |
315 | 318 |
316 // The vector of browser actions (icons/image buttons for each action). Note | 319 // The vector of browser actions (icons/image buttons for each action). Note |
317 // that not every BrowserAction in the ToolbarModel will necessarily be in | 320 // that not every BrowserAction in the ToolbarModel will necessarily be in |
318 // this collection. Some extensions may be disabled in incognito windows. | 321 // this collection. Some extensions may be disabled in incognito windows. |
319 BrowserActionViews browser_action_views_; | 322 BrowserActionViews browser_action_views_; |
320 | 323 |
321 Profile* profile_; | 324 Profile* profile_; |
322 | 325 |
323 // The Browser object the container is associated with. | 326 // The Browser object the container is associated with. |
324 Browser* browser_; | 327 Browser* browser_; |
(...skipping 47 matching lines...) Loading... | |
372 | 375 |
373 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; | 376 base::WeakPtrFactory<BrowserActionsContainer> task_factory_; |
374 | 377 |
375 // Handles delayed showing of the overflow menu when hovering. | 378 // Handles delayed showing of the overflow menu when hovering. |
376 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; | 379 base::WeakPtrFactory<BrowserActionsContainer> show_menu_task_factory_; |
377 | 380 |
378 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); | 381 DISALLOW_COPY_AND_ASSIGN(BrowserActionsContainer); |
379 }; | 382 }; |
380 | 383 |
381 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ | 384 #endif // CHROME_BROWSER_UI_VIEWS_BROWSER_ACTIONS_CONTAINER_H_ |
OLD | NEW |