Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(2530)

Unified Diff: chrome/browser/ui/extensions/hosted_app_browser_controller.h

Issue 1164873003: Show origin for hosted apps that navigate away from their start origin. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: feedback for the stig Created 5 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/extensions/hosted_app_browser_controller.h
diff --git a/chrome/browser/ui/extensions/hosted_app_browser_controller.h b/chrome/browser/ui/extensions/hosted_app_browser_controller.h
new file mode 100644
index 0000000000000000000000000000000000000000..09384d0762ed58da6f05a7f25e41bec81dfb0b51
--- /dev/null
+++ b/chrome/browser/ui/extensions/hosted_app_browser_controller.h
@@ -0,0 +1,51 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_
+#define CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_
+
+#include <string>
+
+#include "base/macros.h"
+
+class Browser;
+class Profile;
+
+namespace extensions {
+
+// Class to encapsulate logic to control the browser UI for hosted apps.
+class HostedAppBrowserController {
+ public:
+ // Indicates whether |browser| is a hosted app browser.
+ static bool IsForHostedApp(Browser* browser);
+
+ explicit HostedAppBrowserController(Browser* browser);
+ ~HostedAppBrowserController();
+
+ // Whether the browser being controlled can ever show the location bar.
+ bool SupportsLocationBar() const;
+
+ // Whether the browser being controlled should be currently showing the
+ // location bar.
+ bool ShouldShowLocationBar() const;
+
+ // Updates the location bar visibility based on whether it should be
+ // currently visible or not. If |animate| is set, the change will be
+ // animated.
+ void UpdateLocationBarVisibility(bool animate) const;
+
+ // Whether the controlled browser should use the web app style frame.
+ bool should_use_web_app_frame() const { return should_use_web_app_frame_; }
+
+ private:
+ Browser* browser_;
+ const std::string extension_id_;
+ bool should_use_web_app_frame_;
+
+ DISALLOW_COPY_AND_ASSIGN(HostedAppBrowserController);
+};
+
+} // namespace extensions
+
+#endif // CHROME_BROWSER_UI_EXTENSIONS_HOSTED_APP_BROWSER_CONTROLLER_H_

Powered by Google App Engine
This is Rietveld 408576698