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

Side by Side Diff: ui/gfx/screen_gtk.cc

Issue 11110004: Make gfx::Rect class operations consistently mutate the class they are called on. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: cc/ fixes Created 8 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 unified diff | Download patch
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "ui/gfx/screen.h" 5 #include "ui/gfx/screen.h"
6 6
7 #include <gdk/gdkx.h> 7 #include <gdk/gdkx.h>
8 #include <gtk/gtk.h> 8 #include <gtk/gtk.h>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
150 return GetPrimaryDisplay(); 150 return GetPrimaryDisplay();
151 } 151 }
152 152
153 // Returns the primary display. 153 // Returns the primary display.
154 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE { 154 virtual gfx::Display GetPrimaryDisplay() const OVERRIDE {
155 gfx::Rect bounds = NativePrimaryMonitorBounds(); 155 gfx::Rect bounds = NativePrimaryMonitorBounds();
156 // TODO(oshima): Implement ID and Observer. 156 // TODO(oshima): Implement ID and Observer.
157 gfx::Display display(0, bounds); 157 gfx::Display display(0, bounds);
158 gfx::Rect rect; 158 gfx::Rect rect;
159 if (GetScreenWorkArea(&rect)) { 159 if (GetScreenWorkArea(&rect)) {
160 display.set_work_area(rect.Intersect(bounds)); 160 bounds.Intersect(rect);
161 display.set_work_area(bounds);
161 } else { 162 } else {
162 // Return the best we've got. 163 // Return the best we've got.
163 display.set_work_area(bounds); 164 display.set_work_area(bounds);
164 } 165 }
165 return display; 166 return display;
166 } 167 }
167 168
168 private: 169 private:
169 DISALLOW_COPY_AND_ASSIGN(ScreenGtk); 170 DISALLOW_COPY_AND_ASSIGN(ScreenGtk);
170 }; 171 };
171 172
172 } // namespace 173 } // namespace
173 174
174 namespace gfx { 175 namespace gfx {
175 176
176 Screen* CreateNativeScreen() { 177 Screen* CreateNativeScreen() {
177 return new ScreenGtk; 178 return new ScreenGtk;
178 } 179 }
179 180
180 } // namespace gfx 181 } // namespace gfx
OLDNEW
« no previous file with comments | « ui/gfx/render_text_win.cc ('k') | ui/gfx/screen_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698