| OLD | NEW |
| 1 // Copyright 2014 The Chromium Authors. All rights reserved. | 1 // Copyright 2014 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 "base/macros.h" | 5 #include "base/macros.h" |
| 6 #include "base/memory/ref_counted.h" | 6 #include "base/memory/ref_counted.h" |
| 7 #include "base/memory/scoped_ptr.h" | 7 #include "base/memory/scoped_ptr.h" |
| 8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" | 8 #include "chrome/browser/extensions/api/extension_action/extension_action_api.h" |
| 9 #include "chrome/browser/extensions/extension_service.h" | 9 #include "chrome/browser/extensions/extension_service.h" |
| 10 #include "chrome/browser/extensions/extension_service_test_base.h" | 10 #include "chrome/browser/extensions/extension_service_test_base.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 } | 68 } |
| 69 | 69 |
| 70 virtual void ToolbarExtensionMoved(const Extension* extension, | 70 virtual void ToolbarExtensionMoved(const Extension* extension, |
| 71 int index) OVERRIDE { | 71 int index) OVERRIDE { |
| 72 ++moved_count_; | 72 ++moved_count_; |
| 73 } | 73 } |
| 74 | 74 |
| 75 virtual void ToolbarExtensionUpdated(const Extension* extension) OVERRIDE { | 75 virtual void ToolbarExtensionUpdated(const Extension* extension) OVERRIDE { |
| 76 } | 76 } |
| 77 | 77 |
| 78 virtual bool ShowExtensionActionPopup(const Extension* extension) OVERRIDE { | 78 virtual bool ShowExtensionActionPopup(const Extension* extension, |
| 79 bool grant_active_tab) OVERRIDE { |
| 79 return false; | 80 return false; |
| 80 } | 81 } |
| 81 | 82 |
| 82 virtual void ToolbarVisibleCountChanged() OVERRIDE { | 83 virtual void ToolbarVisibleCountChanged() OVERRIDE { |
| 83 } | 84 } |
| 84 | 85 |
| 85 virtual void ToolbarHighlightModeChanged(bool is_highlighting) OVERRIDE { | 86 virtual void ToolbarHighlightModeChanged(bool is_highlighting) OVERRIDE { |
| 86 // Add one if highlighting, subtract one if not. | 87 // Add one if highlighting, subtract one if not. |
| 87 highlight_mode_count_ += is_highlighting ? 1 : -1; | 88 highlight_mode_count_ += is_highlighting ? 1 : -1; |
| 88 } | 89 } |
| 89 | 90 |
| 91 virtual Browser* GetBrowser() OVERRIDE { |
| 92 return NULL; |
| 93 } |
| 94 |
| 90 ExtensionToolbarModel* model_; | 95 ExtensionToolbarModel* model_; |
| 91 | 96 |
| 92 size_t inserted_count_; | 97 size_t inserted_count_; |
| 93 size_t removed_count_; | 98 size_t removed_count_; |
| 94 size_t moved_count_; | 99 size_t moved_count_; |
| 95 // Int because it could become negative (if something goes wrong). | 100 // Int because it could become negative (if something goes wrong). |
| 96 int highlight_mode_count_; | 101 int highlight_mode_count_; |
| 97 }; | 102 }; |
| 98 | 103 |
| 99 ExtensionToolbarModelTestObserver::ExtensionToolbarModelTestObserver( | 104 ExtensionToolbarModelTestObserver::ExtensionToolbarModelTestObserver( |
| (...skipping 711 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 811 ExtensionActionAPI::SetBrowserActionVisibility( | 816 ExtensionActionAPI::SetBrowserActionVisibility( |
| 812 prefs, extension_b->id(), true); | 817 prefs, extension_b->id(), true); |
| 813 EXPECT_EQ(3u, num_toolbar_items()); | 818 EXPECT_EQ(3u, num_toolbar_items()); |
| 814 EXPECT_EQ(-1, toolbar_model()->GetVisibleIconCount()); // -1 = 'all' | 819 EXPECT_EQ(-1, toolbar_model()->GetVisibleIconCount()); // -1 = 'all' |
| 815 EXPECT_EQ(extension_c, GetExtensionAtIndex(0u)); | 820 EXPECT_EQ(extension_c, GetExtensionAtIndex(0u)); |
| 816 EXPECT_EQ(extension_a, GetExtensionAtIndex(1u)); | 821 EXPECT_EQ(extension_a, GetExtensionAtIndex(1u)); |
| 817 EXPECT_EQ(extension_b, GetExtensionAtIndex(2u)); | 822 EXPECT_EQ(extension_b, GetExtensionAtIndex(2u)); |
| 818 } | 823 } |
| 819 | 824 |
| 820 } // namespace extensions | 825 } // namespace extensions |
| OLD | NEW |