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

Side by Side Diff: chrome/browser/extensions/browser_action_test_util.h

Issue 1330423003: [Extensions Toolbar] Protect against crazy bounds (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Final nits Created 5 years, 3 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
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ 5 #ifndef CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_
6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ 6 #define CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_
7 7
8 #include <string> 8 #include <string>
9 9
10 #include "base/memory/scoped_ptr.h" 10 #include "base/memory/scoped_ptr.h"
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 // Returns the size of the current browser action popup. 79 // Returns the size of the current browser action popup.
80 gfx::Size GetPopupSize(); 80 gfx::Size GetPopupSize();
81 81
82 // Hides the given popup and returns whether the hide was successful. 82 // Hides the given popup and returns whether the hide was successful.
83 bool HidePopup(); 83 bool HidePopup();
84 84
85 // Tests that the button at the given |index| is displaying that it wants 85 // Tests that the button at the given |index| is displaying that it wants
86 // to run. 86 // to run.
87 bool ActionButtonWantsToRun(size_t index); 87 bool ActionButtonWantsToRun(size_t index);
88 88
89 // Sets the current width of the browser actions container without resizing
90 // the underlying controller. This is to simulate e.g. when the browser window
91 // is too small for the preferred width.
92 void SetWidth(int width);
93
89 // Returns the ToolbarActionsBar. 94 // Returns the ToolbarActionsBar.
90 ToolbarActionsBar* GetToolbarActionsBar(); 95 ToolbarActionsBar* GetToolbarActionsBar();
91 96
92 // Creates and returns a BrowserActionTestUtil with an "overflow" container, 97 // Creates and returns a BrowserActionTestUtil with an "overflow" container,
93 // with this object's container as the main bar. 98 // with this object's container as the main bar.
94 scoped_ptr<BrowserActionTestUtil> CreateOverflowBar(); 99 scoped_ptr<BrowserActionTestUtil> CreateOverflowBar();
95 100
96 // Returns the minimum allowed size of an extension popup. 101 // Returns the minimum allowed size of an extension popup.
97 static gfx::Size GetMinPopupSize(); 102 static gfx::Size GetMinPopupSize();
98 103
99 // Returns the maximum allowed size of an extension popup. 104 // Returns the maximum allowed size of an extension popup.
100 static gfx::Size GetMaxPopupSize(); 105 static gfx::Size GetMaxPopupSize();
101 106
102 private: 107 private:
103 // A private constructor to create an overflow version. 108 // A private constructor to create an overflow version.
104 BrowserActionTestUtil(Browser* browser, BrowserActionTestUtil* main_bar); 109 BrowserActionTestUtil(Browser* browser, BrowserActionTestUtil* main_bar);
105 110
106 Browser* browser_; // weak 111 Browser* browser_; // weak
107 112
108 // Our test helper, which constructs and owns the views if we don't have a 113 // Our test helper, which constructs and owns the views if we don't have a
109 // real browser window, or if this is an overflow version. 114 // real browser window, or if this is an overflow version.
110 scoped_ptr<TestToolbarActionsBarHelper> test_helper_; 115 scoped_ptr<TestToolbarActionsBarHelper> test_helper_;
111 116
112 DISALLOW_COPY_AND_ASSIGN(BrowserActionTestUtil); 117 DISALLOW_COPY_AND_ASSIGN(BrowserActionTestUtil);
113 }; 118 };
114 119
115 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_ 120 #endif // CHROME_BROWSER_EXTENSIONS_BROWSER_ACTION_TEST_UTIL_H_
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/extensions/browser_action_test_util_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698