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
3 // found in the LICENSE file.
5 #ifndef CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_
10 #include "base/macros.h"
15 namespace extensions
{
17 // Class to encapsulate logic to control the browser UI for hosted apps.
18 class HostedAppBrowserController
{
20 // Indicates whether |browser| is a hosted app browser.
21 static bool IsForHostedApp(Browser
* browser
);
23 explicit HostedAppBrowserController(Browser
* browser
);
24 ~HostedAppBrowserController();
26 // Whether the browser being controlled can ever show the location bar.
27 bool SupportsLocationBar() const;
29 // Whether the browser being controlled should be currently showing the
31 bool ShouldShowLocationBar() const;
33 // Updates the location bar visibility based on whether it should be
34 // currently visible or not. If |animate| is set, the change will be
36 void UpdateLocationBarVisibility(bool animate
) const;
38 // Whether the controlled browser should use the web app style frame.
39 bool should_use_web_app_frame() const { return should_use_web_app_frame_
; }
43 const std::string extension_id_
;
44 bool should_use_web_app_frame_
;
46 DISALLOW_COPY_AND_ASSIGN(HostedAppBrowserController
);
49 } // namespace extensions
51 #endif // CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_