| 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 290 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 301 gfx::Point point(action_view->x(), action_view->y()); | 301 gfx::Point point(action_view->x(), action_view->y()); |
| 302 EXPECT_TRUE(container->CanStartDragForView(action_view, point, point)); | 302 EXPECT_TRUE(container->CanStartDragForView(action_view, point, point)); |
| 303 | 303 |
| 304 extensions::ExtensionToolbarModel* model = | 304 extensions::ExtensionToolbarModel* model = |
| 305 extensions::ExtensionToolbarModel::Get(profile()); | 305 extensions::ExtensionToolbarModel::Get(profile()); |
| 306 | 306 |
| 307 extensions::ExtensionIdList extension_ids; | 307 extensions::ExtensionIdList extension_ids; |
| 308 extension_ids.push_back(extension_a()->id()); | 308 extension_ids.push_back(extension_a()->id()); |
| 309 extension_ids.push_back(extension_b()->id()); | 309 extension_ids.push_back(extension_b()->id()); |
| 310 model->HighlightExtensions(extension_ids); | 310 model->HighlightExtensions(extension_ids); |
| 311 | |
| 312 // Only two browser actions should be visible. | 311 // Only two browser actions should be visible. |
| 313 EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions()); | 312 EXPECT_EQ(2, browser_actions_bar()->VisibleBrowserActions()); |
| 314 EXPECT_EQ(2, browser_actions_bar()->NumberOfBrowserActions()); | 313 EXPECT_EQ(2, browser_actions_bar()->NumberOfBrowserActions()); |
| 315 | 314 |
| 316 // We shouldn't be able to drag in highlight mode. | 315 // We shouldn't be able to drag in highlight mode. |
| 317 action_view = container->GetToolbarActionViewAt(0); | 316 action_view = container->GetToolbarActionViewAt(0); |
| 318 EXPECT_FALSE(container->CanStartDragForView(action_view, point, point)); | 317 EXPECT_FALSE(container->CanStartDragForView(action_view, point, point)); |
| 319 | 318 |
| 320 // We should go back to normal after leaving highlight mode. | 319 // We should go back to normal after leaving highlight mode. |
| 321 model->StopHighlighting(); | 320 model->StopHighlighting(); |
| (...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 542 | 541 |
| 543 main_bar()->OnDragUpdated(target_event3); | 542 main_bar()->OnDragUpdated(target_event3); |
| 544 main_bar()->OnPerformDrop(target_event3); | 543 main_bar()->OnPerformDrop(target_event3); |
| 545 | 544 |
| 546 // Order should be A C B, and there should be no extensions in overflow. | 545 // Order should be A C B, and there should be no extensions in overflow. |
| 547 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); | 546 EXPECT_EQ(extension_a()->id(), main_bar()->GetIdAt(0u)); |
| 548 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); | 547 EXPECT_EQ(extension_c()->id(), main_bar()->GetIdAt(1u)); |
| 549 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); | 548 EXPECT_EQ(extension_b()->id(), main_bar()->GetIdAt(2u)); |
| 550 VerifyVisibleCount(3u); | 549 VerifyVisibleCount(3u); |
| 551 } | 550 } |
| OLD | NEW |