| 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 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include "base/strings/string16.h" | 8 #include "base/strings/string16.h" |
| 9 #include "ui/base/page_transition_types.h" | 9 #include "ui/base/page_transition_types.h" |
| 10 #include "ui/base/window_open_disposition.h" | 10 #include "ui/base/window_open_disposition.h" |
| (...skipping 26 matching lines...) Expand all Loading... |
| 37 virtual void Update(const content::WebContents* contents) = 0; | 37 virtual void Update(const content::WebContents* contents) = 0; |
| 38 | 38 |
| 39 // Called when anything has changed that might affect the layout or contents | 39 // Called when anything has changed that might affect the layout or contents |
| 40 // of the views around the edit, including the text of the edit and the | 40 // of the views around the edit, including the text of the edit and the |
| 41 // status of any keyword- or hint-related state. | 41 // status of any keyword- or hint-related state. |
| 42 virtual void OnChanged() = 0; | 42 virtual void OnChanged() = 0; |
| 43 | 43 |
| 44 // Called whenever the autocomplete edit gets focused. | 44 // Called whenever the autocomplete edit gets focused. |
| 45 virtual void OnSetFocus() = 0; | 45 virtual void OnSetFocus() = 0; |
| 46 | 46 |
| 47 // Hides the origin chip and shows the URL. | 47 // Shows the URL. |
| 48 virtual void ShowURL() = 0; | 48 virtual void ShowURL() = 0; |
| 49 | 49 |
| 50 // Hides the origin chip while leaving the Omnibox empty. | |
| 51 void HideOriginChip(); | |
| 52 | |
| 53 // Shows the origin chip. Hides the URL if it was previously shown by a call | |
| 54 // to ShowURL(). | |
| 55 void ShowOriginChip(); | |
| 56 | |
| 57 // Ends any in-progress animations related to showing/hiding the origin chip. | |
| 58 // If |cancel_fade| is false, we still allow the chip itself to fade in if | |
| 59 // we're ending a currently-running hide animation. | |
| 60 virtual void EndOriginChipAnimations(bool cancel_fade) = 0; | |
| 61 | |
| 62 // Returns the InstantController, or NULL if instant is not enabled. | 50 // Returns the InstantController, or NULL if instant is not enabled. |
| 63 virtual InstantController* GetInstant() = 0; | 51 virtual InstantController* GetInstant() = 0; |
| 64 | 52 |
| 65 // Returns the WebContents of the currently active tab. | 53 // Returns the WebContents of the currently active tab. |
| 66 virtual content::WebContents* GetWebContents() = 0; | 54 virtual content::WebContents* GetWebContents() = 0; |
| 67 | 55 |
| 68 virtual ToolbarModel* GetToolbarModel() = 0; | 56 virtual ToolbarModel* GetToolbarModel() = 0; |
| 69 virtual const ToolbarModel* GetToolbarModel() const = 0; | 57 virtual const ToolbarModel* GetToolbarModel() const = 0; |
| 70 | 58 |
| 71 protected: | 59 protected: |
| 72 explicit OmniboxEditController(CommandUpdater* command_updater); | 60 explicit OmniboxEditController(CommandUpdater* command_updater); |
| 73 virtual ~OmniboxEditController(); | 61 virtual ~OmniboxEditController(); |
| 74 | 62 |
| 75 // Hides the URL and shows the origin chip. | |
| 76 virtual void HideURL() = 0; | |
| 77 | |
| 78 CommandUpdater* command_updater() { return command_updater_; } | 63 CommandUpdater* command_updater() { return command_updater_; } |
| 79 GURL destination_url() const { return destination_url_; } | 64 GURL destination_url() const { return destination_url_; } |
| 80 WindowOpenDisposition disposition() const { return disposition_; } | 65 WindowOpenDisposition disposition() const { return disposition_; } |
| 81 ui::PageTransition transition() const { return transition_; } | 66 ui::PageTransition transition() const { return transition_; } |
| 82 | 67 |
| 83 private: | 68 private: |
| 84 CommandUpdater* command_updater_; | 69 CommandUpdater* command_updater_; |
| 85 | 70 |
| 86 // The details necessary to open the user's desired omnibox match. | 71 // The details necessary to open the user's desired omnibox match. |
| 87 GURL destination_url_; | 72 GURL destination_url_; |
| 88 WindowOpenDisposition disposition_; | 73 WindowOpenDisposition disposition_; |
| 89 ui::PageTransition transition_; | 74 ui::PageTransition transition_; |
| 90 | 75 |
| 91 DISALLOW_COPY_AND_ASSIGN(OmniboxEditController); | 76 DISALLOW_COPY_AND_ASSIGN(OmniboxEditController); |
| 92 }; | 77 }; |
| 93 | 78 |
| 94 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_CONTROLLER_H_ | 79 #endif // CHROME_BROWSER_UI_OMNIBOX_OMNIBOX_EDIT_CONTROLLER_H_ |
| OLD | NEW |