| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 2015 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_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_ | 5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_ |
| 6 #define CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_ | 6 #define CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_ |
| 7 | 7 |
| 8 #include <string> | 8 #include <string> |
| 9 | 9 |
| 10 #include "base/macros.h" | 10 #include "base/macros.h" |
| 11 | 11 |
| 12 class Browser; | 12 class Browser; |
| 13 | 13 |
| 14 namespace extensions { | 14 namespace extensions { |
| 15 | 15 |
| 16 // Class to encapsulate logic to control the browser UI for hosted apps. | 16 // Class to encapsulate logic to control the browser UI for hosted apps. |
| 17 class HostedAppBrowserController { | 17 class HostedAppBrowserController { |
| 18 public: | 18 public: |
| 19 // Indicates whether |browser| is a hosted app browser. | 19 // Indicates whether |browser| is a hosted app browser. |
| 20 static bool IsForHostedApp(Browser* browser); | 20 static bool IsForHostedApp(Browser* browser); |
| 21 | 21 |
| 22 explicit HostedAppBrowserController(Browser* browser); | 22 explicit HostedAppBrowserController(Browser* browser); |
| 23 ~HostedAppBrowserController(); | 23 ~HostedAppBrowserController(); |
| 24 | 24 |
| 25 // Whether the browser being controlled can ever show the location bar. | |
| 26 bool SupportsLocationBar() const; | |
| 27 | |
| 28 // Whether the browser being controlled should be currently showing the | 25 // Whether the browser being controlled should be currently showing the |
| 29 // location bar. | 26 // location bar. |
| 30 bool ShouldShowLocationBar() const; | 27 bool ShouldShowLocationBar() const; |
| 31 | 28 |
| 32 // Updates the location bar visibility based on whether it should be | 29 // Updates the location bar visibility based on whether it should be |
| 33 // currently visible or not. If |animate| is set, the change will be | 30 // currently visible or not. If |animate| is set, the change will be |
| 34 // animated. | 31 // animated. |
| 35 void UpdateLocationBarVisibility(bool animate) const; | 32 void UpdateLocationBarVisibility(bool animate) const; |
| 36 | 33 |
| 37 // Whether the controlled browser should use the web app style frame. | |
| 38 bool should_use_web_app_frame() const { return should_use_web_app_frame_; } | |
| 39 | |
| 40 private: | 34 private: |
| 41 Browser* browser_; | 35 Browser* browser_; |
| 42 const std::string extension_id_; | 36 const std::string extension_id_; |
| 43 bool should_use_web_app_frame_; | |
| 44 | 37 |
| 45 DISALLOW_COPY_AND_ASSIGN(HostedAppBrowserController); | 38 DISALLOW_COPY_AND_ASSIGN(HostedAppBrowserController); |
| 46 }; | 39 }; |
| 47 | 40 |
| 48 } // namespace extensions | 41 } // namespace extensions |
| 49 | 42 |
| 50 #endif // CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_ | 43 #endif // CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_ |
| OLD | NEW |