Commit 56073dca authored by mad@chromium.org's avatar mad@chromium.org

Make Browser aware of HostDesktopType.


BUG=None
TEST=None


Review URL: https://chromiumcodereview.appspot.com/10825284

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@151056 0039d316-1c4b-4281-b951-d872f2087c98
parent cab79f85
......@@ -255,6 +255,14 @@ BrowserWindow* CreateBrowserWindow(Browser* browser) {
return BrowserWindow::CreateBrowserWindow(browser);
}
#if defined(OS_CHROMEOS)
chrome::HostDesktopType kDefaultHostDesktopType = chrome::HOST_DESKTOP_TYPE_ASH;
#else
chrome::HostDesktopType kDefaultHostDesktopType =
chrome::HOST_DESKTOP_TYPE_NATIVE;
#endif
} // namespace
////////////////////////////////////////////////////////////////////////////////
......@@ -263,6 +271,7 @@ BrowserWindow* CreateBrowserWindow(Browser* browser) {
Browser::CreateParams::CreateParams()
: type(TYPE_TABBED),
profile(NULL),
host_desktop_type(kDefaultHostDesktopType),
app_type(APP_TYPE_HOST),
initial_show_state(ui::SHOW_STATE_DEFAULT),
is_session_restore(false),
......@@ -270,17 +279,31 @@ Browser::CreateParams::CreateParams()
}
Browser::CreateParams::CreateParams(Profile* profile)
: type(TYPE_TABBED),
profile(profile),
app_type(APP_TYPE_HOST),
initial_show_state(ui::SHOW_STATE_DEFAULT),
is_session_restore(false),
window(NULL) {
: type(TYPE_TABBED),
profile(profile),
host_desktop_type(kDefaultHostDesktopType),
app_type(APP_TYPE_HOST),
initial_show_state(ui::SHOW_STATE_DEFAULT),
is_session_restore(false),
window(NULL) {
}
Browser::CreateParams::CreateParams(Type type, Profile* profile)
: type(type),
profile(profile),
host_desktop_type(kDefaultHostDesktopType),
app_type(APP_TYPE_HOST),
initial_show_state(ui::SHOW_STATE_DEFAULT),
is_session_restore(false),
window(NULL) {
}
Browser::CreateParams::CreateParams(Type type,
Profile* profile,
chrome::HostDesktopType host_desktop_type)
: type(type),
profile(profile),
host_desktop_type(host_desktop_type),
app_type(APP_TYPE_HOST),
initial_show_state(ui::SHOW_STATE_DEFAULT),
is_session_restore(false),
......@@ -335,6 +358,7 @@ Browser::Browser(const CreateParams& params)
override_bounds_(params.initial_bounds),
initial_show_state_(params.initial_show_state),
is_session_restore_(params.is_session_restore),
host_desktop_type_(params.host_desktop_type),
ALLOW_THIS_IN_INITIALIZER_LIST(
unload_controller_(new chrome::UnloadController(this))),
weak_factory_(this),
......
......@@ -26,6 +26,7 @@
#include "chrome/browser/ui/bookmarks/bookmark_tab_helper_delegate.h"
#include "chrome/browser/ui/browser_navigator.h"
#include "chrome/browser/ui/constrained_window_tab_helper_delegate.h"
#include "chrome/browser/ui/host_desktop.h"
#include "chrome/browser/ui/search_engines/search_engine_tab_helper_delegate.h"
#include "chrome/browser/ui/tab_contents/core_tab_helper_delegate.h"
#include "chrome/browser/ui/tabs/tab_strip_model_observer.h"
......@@ -158,6 +159,9 @@ class Browser : public TabStripModelObserver,
CreateParams();
explicit CreateParams(Profile* profile);
CreateParams(Type type, Profile* profile);
CreateParams(Type type,
Profile* profile,
chrome::HostDesktopType host_desktop_type);
static CreateParams CreateForApp(Type type,
const std::string& app_name,
......@@ -172,6 +176,9 @@ class Browser : public TabStripModelObserver,
// The associated profile.
Profile* profile;
// 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.
......@@ -219,6 +226,9 @@ class Browser : public TabStripModelObserver,
bool is_session_restore() const {
return is_session_restore_;
}
chrome::HostDesktopType host_desktop_type() {
return host_desktop_type_;
};
// Accessors ////////////////////////////////////////////////////////////////
......@@ -863,6 +873,8 @@ class Browser : public TabStripModelObserver,
// Tracks when this browser is being created by session restore.
bool is_session_restore_;
chrome::HostDesktopType host_desktop_type_;
scoped_ptr<chrome::UnloadController> unload_controller_;
// The following factory is used to close the frame at a later time.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment