| 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 #include "chrome/browser/extensions/extension_context_menu_model.h" | 5 #include "chrome/browser/extensions/extension_context_menu_model.h" |
| 6 | 6 |
| 7 #include <utility> | 7 #include <utility> |
| 8 | 8 |
| 9 #include "base/macros.h" | 9 #include "base/macros.h" |
| 10 #include "base/memory/ptr_util.h" | 10 #include "base/memory/ptr_util.h" |
| (...skipping 165 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 176 .SetLocation(location) | 176 .SetLocation(location) |
| 177 .Build(); | 177 .Build(); |
| 178 if (!extension.get()) | 178 if (!extension.get()) |
| 179 ADD_FAILURE(); | 179 ADD_FAILURE(); |
| 180 service()->AddExtension(extension.get()); | 180 service()->AddExtension(extension.get()); |
| 181 return extension.get(); | 181 return extension.get(); |
| 182 } | 182 } |
| 183 | 183 |
| 184 Browser* ExtensionContextMenuModelTest::GetBrowser() { | 184 Browser* ExtensionContextMenuModelTest::GetBrowser() { |
| 185 if (!browser_) { | 185 if (!browser_) { |
| 186 Browser::CreateParams params(profile()); | 186 Browser::CreateParams params(profile(), true); |
| 187 test_window_.reset(new TestBrowserWindow()); | 187 test_window_.reset(new TestBrowserWindow()); |
| 188 params.window = test_window_.get(); | 188 params.window = test_window_.get(); |
| 189 browser_.reset(new Browser(params)); | 189 browser_.reset(new Browser(params)); |
| 190 } | 190 } |
| 191 return browser_.get(); | 191 return browser_.get(); |
| 192 } | 192 } |
| 193 | 193 |
| 194 void ExtensionContextMenuModelTest::SetUp() { | 194 void ExtensionContextMenuModelTest::SetUp() { |
| 195 ExtensionServiceTestBase::SetUp(); | 195 ExtensionServiceTestBase::SetUp(); |
| 196 if (content::IsBrowserSideNavigationEnabled()) | 196 if (content::IsBrowserSideNavigationEnabled()) |
| (...skipping 435 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 632 "no_action", nullptr, Manifest::INTERNAL); | 632 "no_action", nullptr, Manifest::INTERNAL); |
| 633 ExtensionContextMenuModel menu(no_action, GetBrowser(), | 633 ExtensionContextMenuModel menu(no_action, GetBrowser(), |
| 634 ExtensionContextMenuModel::VISIBLE, nullptr); | 634 ExtensionContextMenuModel::VISIBLE, nullptr); |
| 635 int inspect_popup_index = | 635 int inspect_popup_index = |
| 636 menu.GetIndexOfCommandId(ExtensionContextMenuModel::INSPECT_POPUP); | 636 menu.GetIndexOfCommandId(ExtensionContextMenuModel::INSPECT_POPUP); |
| 637 EXPECT_EQ(-1, inspect_popup_index); | 637 EXPECT_EQ(-1, inspect_popup_index); |
| 638 } | 638 } |
| 639 } | 639 } |
| 640 | 640 |
| 641 } // namespace extensions | 641 } // namespace extensions |
| OLD | NEW |