| OLD | NEW |
| 1 // Copyright 2013 The Chromium Authors. All rights reserved. | 1 // Copyright 2013 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/ui/views/toolbar/browser_actions_container.h" | 5 #include "chrome/browser/ui/views/toolbar/browser_actions_container.h" |
| 6 | 6 |
| 7 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 7 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 8 #include "chrome/browser/extensions/browser_action_test_util.h" | 8 #include "chrome/browser/extensions/browser_action_test_util.h" |
| 9 #include "chrome/browser/extensions/extension_toolbar_model.h" | 9 #include "chrome/browser/extensions/extension_toolbar_model.h" |
| 10 #include "chrome/browser/ui/browser_window.h" | 10 #include "chrome/browser/ui/browser_window.h" |
| (...skipping 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 194 | 194 |
| 195 // Currently, dragging should be enabled. | 195 // Currently, dragging should be enabled. |
| 196 ToolbarActionView* action_view = container->GetToolbarActionViewAt(0); | 196 ToolbarActionView* action_view = container->GetToolbarActionViewAt(0); |
| 197 ASSERT_TRUE(action_view); | 197 ASSERT_TRUE(action_view); |
| 198 gfx::Point point(action_view->x(), action_view->y()); | 198 gfx::Point point(action_view->x(), action_view->y()); |
| 199 EXPECT_TRUE(container->CanStartDragForView(action_view, point, point)); | 199 EXPECT_TRUE(container->CanStartDragForView(action_view, point, point)); |
| 200 | 200 |
| 201 extensions::ExtensionIdList extension_ids; | 201 extensions::ExtensionIdList extension_ids; |
| 202 extension_ids.push_back(extension_a()->id()); | 202 extension_ids.push_back(extension_a()->id()); |
| 203 extension_ids.push_back(extension_b()->id()); | 203 extension_ids.push_back(extension_b()->id()); |
| 204 toolbar_model()->HighlightExtensions(extension_ids); | 204 toolbar_model()->HighlightExtensions( |
| 205 extension_ids, extensions::ExtensionToolbarModel::HIGHLIGHT_WARNING); |
| 205 | 206 |
| 206 // Only two browser actions should be visible. | 207 // Only two browser actions should be visible. |
| 207 EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions()); | 208 EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions()); |
| 208 EXPECT_EQ(2, browser_actions_bar()->NumberOfBrowserActions()); | 209 EXPECT_EQ(2, browser_actions_bar()->NumberOfBrowserActions()); |
| 209 | 210 |
| 210 // We shouldn't be able to drag in highlight mode. | 211 // We shouldn't be able to drag in highlight mode. |
| 211 action_view = container->GetToolbarActionViewAt(0); | 212 action_view = container->GetToolbarActionViewAt(0); |
| 212 EXPECT_FALSE(container->CanStartDragForView(action_view, point, point)); | 213 EXPECT_FALSE(container->CanStartDragForView(action_view, point, point)); |
| 213 | 214 |
| 214 // We should go back to normal after leaving highlight mode. | 215 // We should go back to normal after leaving highlight mode. |
| (...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 425 | 426 |
| 426 main_bar()->OnDragUpdated(target_event3); | 427 main_bar()->OnDragUpdated(target_event3); |
| 427 main_bar()->OnPerformDrop(target_event3); | 428 main_bar()->OnPerformDrop(target_event3); |
| 428 | 429 |
| 429 // Order should be A C B, and there should be no extensions in overflow. | 430 // Order should be A C B, and there should be no extensions in overflow. |
| 430 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); | 431 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); |
| 431 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); | 432 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); |
| 432 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); | 433 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); |
| 433 EXPECT_TRUE(VerifyVisibleCount(3u)); | 434 EXPECT_TRUE(VerifyVisibleCount(3u)); |
| 434 } | 435 } |
| OLD | NEW |