OLD | NEW |
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2010 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 #ifndef CHROME_TEST_TEST_LOCATION_BAR_H_ | 5 #ifndef CHROME_TEST_TEST_LOCATION_BAR_H_ |
6 #define CHROME_TEST_TEST_LOCATION_BAR_H_ | 6 #define CHROME_TEST_TEST_LOCATION_BAR_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include "chrome/browser/first_run/first_run.h" | 9 #include "chrome/browser/first_run/first_run.h" |
10 #include "chrome/browser/ui/omnibox/location_bar.h" | 10 #include "chrome/browser/ui/omnibox/location_bar.h" |
11 #include "chrome/common/page_transition_types.h" | 11 #include "chrome/common/page_transition_types.h" |
12 #include "webkit/glue/window_open_disposition.h" | 12 #include "webkit/glue/window_open_disposition.h" |
13 | 13 |
14 class TestLocationBar : public LocationBar { | 14 class TestLocationBar : public LocationBar { |
15 public: | 15 public: |
16 TestLocationBar(); | 16 TestLocationBar(); |
17 virtual ~TestLocationBar(); | 17 virtual ~TestLocationBar(); |
18 | 18 |
19 void set_input_string(const std::wstring& input_string) { | 19 void set_input_string(const std::wstring& input_string) { |
20 input_string_ = input_string; | 20 input_string_ = input_string; |
21 } | 21 } |
22 void set_disposition(WindowOpenDisposition disposition) { | 22 void set_disposition(WindowOpenDisposition disposition) { |
23 disposition_ = disposition; | 23 disposition_ = disposition; |
24 } | 24 } |
25 void set_transition(PageTransition::Type transition) { | 25 void set_transition(PageTransition::Type transition) { |
26 transition_ = transition; | 26 transition_ = transition; |
27 } | 27 } |
28 | 28 |
29 // Overridden from LocationBar: | 29 // Overridden from LocationBar: |
30 virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) {} | 30 virtual void ShowFirstRunBubble(FirstRun::BubbleType bubble_type) OVERRIDE {} |
31 virtual void SetSuggestedText(const string16& text) {} | 31 virtual void SetSuggestedText(const string16& text, |
32 virtual std::wstring GetInputString() const; | 32 InstantCompleteBehavior behavior) OVERRIDE {} |
33 virtual WindowOpenDisposition GetWindowOpenDisposition() const; | 33 virtual std::wstring GetInputString() const OVERRIDE; |
34 virtual PageTransition::Type GetPageTransition() const; | 34 virtual WindowOpenDisposition GetWindowOpenDisposition() const OVERRIDE; |
35 virtual void AcceptInput() {} | 35 virtual PageTransition::Type GetPageTransition() const OVERRIDE; |
36 virtual void FocusLocation(bool select_all) {} | 36 virtual void AcceptInput() OVERRIDE {} |
37 virtual void FocusSearch() {} | 37 virtual void FocusLocation(bool select_all) OVERRIDE {} |
38 virtual void UpdateContentSettingsIcons() {} | 38 virtual void FocusSearch() OVERRIDE {} |
39 virtual void UpdatePageActions() {} | 39 virtual void UpdateContentSettingsIcons() OVERRIDE {} |
40 virtual void InvalidatePageActions() {} | 40 virtual void UpdatePageActions() OVERRIDE {} |
41 virtual void SaveStateToContents(TabContents* contents) {} | 41 virtual void InvalidatePageActions() OVERRIDE {} |
42 virtual void Revert() {} | 42 virtual void SaveStateToContents(TabContents* contents) OVERRIDE {} |
43 virtual const AutocompleteEditView* location_entry() const; | 43 virtual void Revert() OVERRIDE {} |
44 virtual AutocompleteEditView* location_entry(); | 44 virtual const AutocompleteEditView* location_entry() const OVERRIDE; |
45 virtual LocationBarTesting* GetLocationBarForTesting(); | 45 virtual AutocompleteEditView* location_entry() OVERRIDE; |
| 46 virtual LocationBarTesting* GetLocationBarForTesting() OVERRIDE; |
46 | 47 |
47 private: | 48 private: |
48 | 49 |
49 // Test-supplied values that will be returned through the LocationBar | 50 // Test-supplied values that will be returned through the LocationBar |
50 // interface. | 51 // interface. |
51 std::wstring input_string_; | 52 std::wstring input_string_; |
52 WindowOpenDisposition disposition_; | 53 WindowOpenDisposition disposition_; |
53 PageTransition::Type transition_; | 54 PageTransition::Type transition_; |
54 | 55 |
55 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); | 56 DISALLOW_COPY_AND_ASSIGN(TestLocationBar); |
56 }; | 57 }; |
57 | 58 |
58 | 59 |
59 #endif // CHROME_TEST_TEST_LOCATION_BAR_H_ | 60 #endif // CHROME_TEST_TEST_LOCATION_BAR_H_ |
OLD | NEW |