| 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 #ifndef CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ | 5 #ifndef CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ |
| 6 #define CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ | 6 #define CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ |
| 7 | 7 |
| 8 #include "content/public/common/page_transition_types.h" | 8 #include "content/public/common/page_transition_types.h" |
| 9 #include "ui/base/window_open_disposition.h" | 9 #include "ui/base/window_open_disposition.h" |
| 10 #include "url/gurl.h" | 10 #include "url/gurl.h" |
| 11 | 11 |
| 12 class ExtensionAction; | 12 class ExtensionAction; |
| 13 class LocationBarTesting; | 13 class LocationBarTesting; |
| 14 class OmniboxView; | 14 class OmniboxView; |
| 15 class Profile; | 15 class Profile; |
| 16 | 16 |
| 17 namespace content { | 17 namespace content { |
| 18 class WebContents; | 18 class WebContents; |
| 19 } | 19 } |
| 20 | 20 |
| 21 namespace extensions { |
| 22 class Extension; |
| 23 } |
| 24 |
| 21 // The LocationBar class is a virtual interface, defining access to the | 25 // The LocationBar class is a virtual interface, defining access to the |
| 22 // window's location bar component. This class exists so that cross-platform | 26 // window's location bar component. This class exists so that cross-platform |
| 23 // components like the browser command system can talk to the platform | 27 // components like the browser command system can talk to the platform |
| 24 // specific implementations of the location bar control. It also allows the | 28 // specific implementations of the location bar control. It also allows the |
| 25 // location bar to be mocked for testing. | 29 // location bar to be mocked for testing. |
| 26 class LocationBar { | 30 class LocationBar { |
| 27 public: | 31 public: |
| 28 explicit LocationBar(Profile* profile); | 32 explicit LocationBar(Profile* profile); |
| 29 | 33 |
| 30 // Shows the first run bubble anchored to the location bar. | 34 // Shows the first run bubble anchored to the location bar. |
| (...skipping 20 matching lines...) Expand all Loading... |
| 51 // Updates the password icon and pops up a bubble from the icon if needed. | 55 // Updates the password icon and pops up a bubble from the icon if needed. |
| 52 virtual void UpdateManagePasswordsIconAndBubble() = 0; | 56 virtual void UpdateManagePasswordsIconAndBubble() = 0; |
| 53 | 57 |
| 54 // Updates the state of the page actions. | 58 // Updates the state of the page actions. |
| 55 virtual void UpdatePageActions() = 0; | 59 virtual void UpdatePageActions() = 0; |
| 56 | 60 |
| 57 // Called when the page-action data needs to be refreshed, e.g. when an | 61 // Called when the page-action data needs to be refreshed, e.g. when an |
| 58 // extension is unloaded or crashes. | 62 // extension is unloaded or crashes. |
| 59 virtual void InvalidatePageActions() = 0; | 63 virtual void InvalidatePageActions() = 0; |
| 60 | 64 |
| 65 // Shows the popup for the given |extension| and, if |grant_active_tab| is |
| 66 // true, grants the extension active tab permissions. |
| 67 // Returns true if a popup was shown. |
| 68 virtual bool ShowPageActionPopup(const extensions::Extension* extension, |
| 69 bool grant_active_tab) = 0; |
| 70 |
| 61 // Updates the state of the button to open a PDF in Adobe Reader. | 71 // Updates the state of the button to open a PDF in Adobe Reader. |
| 62 virtual void UpdateOpenPDFInReaderPrompt() = 0; | 72 virtual void UpdateOpenPDFInReaderPrompt() = 0; |
| 63 | 73 |
| 64 // Updates the generated credit card view. This view serves as an anchor for | 74 // Updates the generated credit card view. This view serves as an anchor for |
| 65 // the generated credit card bubble, which can show on successful generation | 75 // the generated credit card bubble, which can show on successful generation |
| 66 // of a new credit card number. | 76 // of a new credit card number. |
| 67 virtual void UpdateGeneratedCreditCardView() = 0; | 77 virtual void UpdateGeneratedCreditCardView() = 0; |
| 68 | 78 |
| 69 // Saves the state of the location bar to the specified WebContents, so that | 79 // Saves the state of the location bar to the specified WebContents, so that |
| 70 // it can be restored later. (Done when switching tabs). | 80 // it can be restored later. (Done when switching tabs). |
| (...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 111 virtual void TestPageActionPressed(size_t index) = 0; | 121 virtual void TestPageActionPressed(size_t index) = 0; |
| 112 | 122 |
| 113 // Returns whether or not the bookmark star decoration is visible. | 123 // Returns whether or not the bookmark star decoration is visible. |
| 114 virtual bool GetBookmarkStarVisibility() = 0; | 124 virtual bool GetBookmarkStarVisibility() = 0; |
| 115 | 125 |
| 116 protected: | 126 protected: |
| 117 virtual ~LocationBarTesting() {} | 127 virtual ~LocationBarTesting() {} |
| 118 }; | 128 }; |
| 119 | 129 |
| 120 #endif // CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ | 130 #endif // CHROME_BROWSER_UI_LOCATION_BAR_LOCATION_BAR_H_ |
| OLD | NEW |