| OLD | NEW |
| 1 // Copyright (c) 2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2009 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 #include "chrome/browser/extensions/browser_action_test_util.h" | 5 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 6 | 6 |
| 7 #include "base/mac/bundle_locations.h" | 7 #include "base/mac/bundle_locations.h" |
| 8 #include "base/mac/foundation_util.h" | 8 #include "base/mac/foundation_util.h" |
| 9 #include "base/path_service.h" | 9 #include "base/path_service.h" |
| 10 #include "base/strings/sys_string_conversions.h" | 10 #include "base/strings/sys_string_conversions.h" |
| (...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 64 | 64 |
| 65 containerView_.reset([[BrowserActionsContainerView alloc] | 65 containerView_.reset([[BrowserActionsContainerView alloc] |
| 66 initWithFrame:NSMakeRect(0, 0, 0, 15)]); | 66 initWithFrame:NSMakeRect(0, 0, 0, 15)]); |
| 67 controller_.reset( | 67 controller_.reset( |
| 68 [[BrowserActionsController alloc] initWithBrowser:browser | 68 [[BrowserActionsController alloc] initWithBrowser:browser |
| 69 containerView:containerView_.get() | 69 containerView:containerView_.get() |
| 70 mainController:mainController]); | 70 mainController:mainController]); |
| 71 } | 71 } |
| 72 | 72 |
| 73 TestToolbarActionsBarHelperCocoa::~TestToolbarActionsBarHelperCocoa() { | 73 TestToolbarActionsBarHelperCocoa::~TestToolbarActionsBarHelperCocoa() { |
| 74 [controller_ browserWillBeDestroyed]; |
| 74 } | 75 } |
| 75 | 76 |
| 76 BrowserActionsController* GetController(Browser* browser, | 77 BrowserActionsController* GetController(Browser* browser, |
| 77 TestToolbarActionsBarHelper* helper) { | 78 TestToolbarActionsBarHelper* helper) { |
| 78 if (helper) { | 79 if (helper) { |
| 79 return static_cast<TestToolbarActionsBarHelperCocoa*>(helper)->controller(); | 80 return static_cast<TestToolbarActionsBarHelperCocoa*>(helper)->controller(); |
| 80 } | 81 } |
| 81 | 82 |
| 82 BrowserWindowCocoa* window = | 83 BrowserWindowCocoa* window = |
| 83 static_cast<BrowserWindowCocoa*>(browser->window()); | 84 static_cast<BrowserWindowCocoa*>(browser->window()); |
| (...skipping 140 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { | 225 gfx::Size BrowserActionTestUtil::GetMaxPopupSize() { |
| 225 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); | 226 return gfx::Size(NSSizeToCGSize([ExtensionPopupController maxPopupSize])); |
| 226 } | 227 } |
| 227 | 228 |
| 228 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, | 229 BrowserActionTestUtil::BrowserActionTestUtil(Browser* browser, |
| 229 BrowserActionTestUtil* main_bar) | 230 BrowserActionTestUtil* main_bar) |
| 230 : browser_(browser), | 231 : browser_(browser), |
| 231 test_helper_(new TestToolbarActionsBarHelperCocoa( | 232 test_helper_(new TestToolbarActionsBarHelperCocoa( |
| 232 browser_, GetController(browser_, main_bar->test_helper_.get()))) { | 233 browser_, GetController(browser_, main_bar->test_helper_.get()))) { |
| 233 } | 234 } |
| OLD | NEW |