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 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" | 5 #import "chrome/browser/ui/cocoa/omnibox/omnibox_view_mac.h" |
6 | 6 |
7 #include <stddef.h> | 7 #include <stddef.h> |
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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
86 class TestingOmniboxEditController : public ChromeOmniboxEditController { | 86 class TestingOmniboxEditController : public ChromeOmniboxEditController { |
87 public: | 87 public: |
88 explicit TestingOmniboxEditController(ToolbarModel* toolbar_model) | 88 explicit TestingOmniboxEditController(ToolbarModel* toolbar_model) |
89 : ChromeOmniboxEditController(NULL), toolbar_model_(toolbar_model) {} | 89 : ChromeOmniboxEditController(NULL), toolbar_model_(toolbar_model) {} |
90 ~TestingOmniboxEditController() override {} | 90 ~TestingOmniboxEditController() override {} |
91 | 91 |
92 protected: | 92 protected: |
93 // Overridden from ChromeOmniboxEditController: | 93 // Overridden from ChromeOmniboxEditController: |
94 void UpdateWithoutTabRestore() override {} | 94 void UpdateWithoutTabRestore() override {} |
95 void OnChanged() override {} | 95 void OnChanged() override {} |
96 void OnSetFocus() override {} | |
97 void ShowURL() override {} | 96 void ShowURL() override {} |
98 ToolbarModel* GetToolbarModel() override { return toolbar_model_; } | 97 ToolbarModel* GetToolbarModel() override { return toolbar_model_; } |
99 const ToolbarModel* GetToolbarModel() const override { | 98 const ToolbarModel* GetToolbarModel() const override { |
100 return toolbar_model_; | 99 return toolbar_model_; |
101 } | 100 } |
102 content::WebContents* GetWebContents() override { return nullptr; } | 101 content::WebContents* GetWebContents() override { return nullptr; } |
103 | 102 |
104 private: | 103 private: |
105 ToolbarModel* toolbar_model_; | 104 ToolbarModel* toolbar_model_; |
106 | 105 |
(...skipping 90 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
197 | 196 |
198 // With popup open verify that pressing up and down arrow works. | 197 // With popup open verify that pressing up and down arrow works. |
199 popup_view.set_is_open(true); | 198 popup_view.set_is_open(true); |
200 model->set_up_or_down_count(0); | 199 model->set_up_or_down_count(0); |
201 view.OnDoCommandBySelector(@selector(moveDown:)); | 200 view.OnDoCommandBySelector(@selector(moveDown:)); |
202 EXPECT_EQ(1, model->up_or_down_count()); | 201 EXPECT_EQ(1, model->up_or_down_count()); |
203 model->set_up_or_down_count(0); | 202 model->set_up_or_down_count(0); |
204 view.OnDoCommandBySelector(@selector(moveUp:)); | 203 view.OnDoCommandBySelector(@selector(moveUp:)); |
205 EXPECT_EQ(-1, model->up_or_down_count()); | 204 EXPECT_EQ(-1, model->up_or_down_count()); |
206 } | 205 } |
OLD | NEW |