Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(270)

Side by Side Diff: chrome/browser/ui/views/browser_actions_container.h

Issue 25305002: Implement initial chrome.browserAction.openPopup API. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: move to interactive_ui_test Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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
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
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. Showing the popup will
313 void ShowPopup(BrowserActionButton* button, 315 // grant tab permissions if |should_grant| is true. Popup's shown via an API
314 ExtensionPopup::ShowAction show_action); 316 // should not grant permissions.
317 bool ShowPopup(BrowserActionButton* button,
318 ExtensionPopup::ShowAction show_action,
319 bool should_grant);
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.
324 Browser* browser_; 329 Browser* browser_;
(...skipping 47 matching lines...) Expand 10 before | Expand all | Expand 10 after
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_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698