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

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

Issue 187443008: Elim Browser::AppType (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase and add non trusted type test Created 6 years, 9 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
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/browser.h
diff --git a/chrome/browser/ui/browser.h b/chrome/browser/ui/browser.h
index 2544bfc8f8f3ac38ed7c2e2bf9e64780ab84206a..61dc953ab20ea7d75b5fe4da6159b595bab94c9e 100644
--- a/chrome/browser/ui/browser.h
+++ b/chrome/browser/ui/browser.h
@@ -110,16 +110,9 @@ class Browser : public TabStripModelObserver,
enum Type {
// If you add a new type, consider updating the test
// BrowserTest.StartMaximized.
- TYPE_TABBED = 1,
- TYPE_POPUP = 2
- };
-
- // Distinguishes between browsers that host an app (opened from
- // ApplicationLauncher::OpenApplication), and child browsers created by an app
- // from Browser::CreateForApp (e.g. by windows.open or the extension API).
- enum AppType {
- APP_TYPE_HOST = 1,
- APP_TYPE_CHILD = 2
+ TYPE_TABBED = 1, // A tabbed browser
+ TYPE_POPUP = 2, // A popup window opened by a browser page or an app
+ TYPE_TRUSTED_POPUP = 3 // A primary hosted app window or system popup
};
// Possible elements of the Browser window.
@@ -174,15 +167,6 @@ class Browser : public TabStripModelObserver,
// The host desktop the browser is created on.
chrome::HostDesktopType host_desktop_type;
- // The application name that is also the name of the window to the shell.
- // This name should be set when:
- // 1) we launch an application via an application shortcut or extension API.
- // 2) we launch an undocked devtool window.
- std::string app_name;
-
- // Type of app (host or child). See description of AppType.
- AppType app_type;
-
// The bounds of the window to open.
gfx::Rect initial_bounds;
@@ -193,6 +177,17 @@ class Browser : public TabStripModelObserver,
// Supply a custom BrowserWindow implementation, to be used instead of the
// default. Intended for testing.
BrowserWindow* window;
+
+ private:
+ friend class Browser;
+
+ // The application name that is also the name of the window to the shell.
+ // Do not set this value directly, use CreateForApp.
+ // This name will be set for:
+ // 1) v1 applications launched via an application shortcut or extension API.
+ // 2) undocked devtool windows.
+ // 3) popup windows spawned from v1 applications.
+ std::string app_name;
};
// Constructors, Creation, Showing //////////////////////////////////////////
@@ -229,7 +224,6 @@ class Browser : public TabStripModelObserver,
Type type() const { return type_; }
const std::string& app_name() const { return app_name_; }
- AppType app_type() const { return app_type_; }
Profile* profile() const { return profile_; }
gfx::Rect override_bounds() const { return override_bounds_; }
@@ -455,7 +449,9 @@ class Browser : public TabStripModelObserver,
const blink::WebGestureEvent& event) OVERRIDE;
bool is_type_tabbed() const { return type_ == TYPE_TABBED; }
- bool is_type_popup() const { return type_ == TYPE_POPUP; }
+ bool is_type_popup() const {
+ return type_ == TYPE_POPUP || type_ == TYPE_TRUSTED_POPUP;
+ }
bool is_app() const;
bool is_devtools() const;
@@ -821,9 +817,6 @@ class Browser : public TabStripModelObserver,
// 2) we launch an undocked devtool window.
std::string app_name_;
- // Type of app (host or child). See description of AppType.
- AppType app_type_;
-
// Unique identifier of this browser for session restore. This id is only
// unique within the current session, and is not guaranteed to be unique
// across sessions.
« no previous file with comments | « chrome/browser/ui/ash/launcher/chrome_launcher_controller_unittest.cc ('k') | chrome/browser/ui/browser.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698