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

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: update a few other gfx::Rect calls 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
« no previous file with comments | « ui/aura/desktop.h ('k') | ui/aura/desktop_host.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/aura/desktop.cc
diff --git a/ui/aura/desktop.cc b/ui/aura/desktop.cc
index 7824c128539dbbab4027ff30a7fec828f72ed9ba..bbc6e2a62e43911c196abe838086fd118055038c 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),
@@ -411,26 +409,29 @@ bool Desktop::IsFocusedWindow(const Window* window) const {
void Desktop::Init() {
Window::Init();
- SetBounds(gfx::Rect(gfx::Point(), host_->GetSize()));
+ SetBounds(gfx::Rect(host_->GetSize()));
Show();
compositor()->SetRootLayer(layer());
}
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(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') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698