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

Unified Diff: ui/aura/desktop.cc

Issue 8374005: aura: Try to make Linux host resize code more reliable. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-add size check Created 9 years, 2 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: ui/aura/desktop.cc
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 7824c128539dbbab4027ff30a7fec828f72ed9ba..9d27fa7a5e811de6482d9f7a044904438f592bdb 100644
--- a/ui/aura/desktop.cc
+++ b/ui/aura/desktop.cc
@@ -41,11 +41,9 @@ static const int kDefaultHostWindowHeight = 1024;
} // namespace
-// static
Desktop* Desktop::instance_ = NULL;
-
-// static
ui::Compositor*(*Desktop::compositor_factory_)() = NULL;
+bool Desktop::use_fullscreen_host_window_ = false;
Desktop::Desktop()
: Window(NULL),
@@ -417,20 +415,23 @@ void Desktop::Init() {
}
gfx::Rect Desktop::GetInitialHostWindowBounds() const {
+ gfx::Rect bounds(kDefaultHostWindowX, kDefaultHostWindowY,
+ kDefaultHostWindowWidth, kDefaultHostWindowHeight);
+
const string size_str = CommandLine::ForCurrentProcess()->GetSwitchValueASCII(
switches::kAuraHostWindowSize);
-
- int width = 0, height = 0;
vector<string> parts;
base::SplitString(size_str, 'x', &parts);
- if (parts.size() != 2 ||
- !base::StringToInt(parts[0], &width) ||
- !base::StringToInt(parts[1], &height) ||
- width <= 0 || height <= 0) {
- width = kDefaultHostWindowWidth;
- height = kDefaultHostWindowHeight;
+ int parsed_width = 0, parsed_height = 0;
+ if (parts.size() == 2 &&
+ base::StringToInt(parts[0], &parsed_width) && parsed_width > 0 &&
+ base::StringToInt(parts[1], &parsed_height) && parsed_height > 0) {
+ bounds.set_size(gfx::Size(parsed_width, parsed_height));
+ } else if (use_fullscreen_host_window_) {
+ bounds = gfx::Rect(gfx::Point(), DesktopHost::GetNativeDisplaySize());
}
- return gfx::Rect(kDefaultHostWindowX, kDefaultHostWindowY, width, height);
+
+ return bounds;
}
} // namespace aura
« no previous file with comments | « ui/aura/desktop.h ('k') | ui/aura/desktop_host.h » ('j') | ui/aura/desktop_host_linux.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698