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

Side by Side Diff: chrome/browser/ui/views/chrome_views_delegate.cc

Issue 9960042: Refactor screen/monitor so that gfx::Screen returns monitor object. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: sync Created 8 years, 8 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 | Annotate | Revision Log
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 "chrome/browser/ui/views/chrome_views_delegate.h" 5 #include "chrome/browser/ui/views/chrome_views_delegate.h"
6 6
7 #include "base/memory/scoped_ptr.h" 7 #include "base/memory/scoped_ptr.h"
8 #include "base/string_util.h" 8 #include "base/string_util.h"
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after
67 67
68 DCHECK(prefs->FindPreference(window_name.c_str())); 68 DCHECK(prefs->FindPreference(window_name.c_str()));
69 DictionaryPrefUpdate update(prefs, window_name.c_str()); 69 DictionaryPrefUpdate update(prefs, window_name.c_str());
70 DictionaryValue* window_preferences = update.Get(); 70 DictionaryValue* window_preferences = update.Get();
71 window_preferences->SetInteger("left", bounds.x()); 71 window_preferences->SetInteger("left", bounds.x());
72 window_preferences->SetInteger("top", bounds.y()); 72 window_preferences->SetInteger("top", bounds.y());
73 window_preferences->SetInteger("right", bounds.right()); 73 window_preferences->SetInteger("right", bounds.right());
74 window_preferences->SetInteger("bottom", bounds.bottom()); 74 window_preferences->SetInteger("bottom", bounds.bottom());
75 window_preferences->SetBoolean("maximized", 75 window_preferences->SetBoolean("maximized",
76 show_state == ui::SHOW_STATE_MAXIMIZED); 76 show_state == ui::SHOW_STATE_MAXIMIZED);
77 77 gfx::Rect work_area(
78 gfx::Rect work_area(gfx::Screen::GetMonitorWorkAreaMatching(bounds)); 78 gfx::Screen::GetMonitorMatching(bounds).work_area());
79 window_preferences->SetInteger("work_area_left", work_area.x()); 79 window_preferences->SetInteger("work_area_left", work_area.x());
80 window_preferences->SetInteger("work_area_top", work_area.y()); 80 window_preferences->SetInteger("work_area_top", work_area.y());
81 window_preferences->SetInteger("work_area_right", work_area.right()); 81 window_preferences->SetInteger("work_area_right", work_area.right());
82 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); 82 window_preferences->SetInteger("work_area_bottom", work_area.bottom());
83 } 83 }
84 84
85 bool ChromeViewsDelegate::GetSavedWindowPlacement( 85 bool ChromeViewsDelegate::GetSavedWindowPlacement(
86 const std::string& window_name, 86 const std::string& window_name,
87 gfx::Rect* bounds, 87 gfx::Rect* bounds,
88 ui::WindowShowState* show_state) const { 88 ui::WindowShowState* show_state) const {
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
163 #if defined(USE_AURA) 163 #if defined(USE_AURA)
164 views::NativeWidgetHelperAura* ChromeViewsDelegate::CreateNativeWidgetHelper( 164 views::NativeWidgetHelperAura* ChromeViewsDelegate::CreateNativeWidgetHelper(
165 views::NativeWidgetAura* native_widget) { 165 views::NativeWidgetAura* native_widget) {
166 #if !defined(USE_ASH) 166 #if !defined(USE_ASH)
167 return new views::DesktopNativeWidgetHelperAura(native_widget); 167 return new views::DesktopNativeWidgetHelperAura(native_widget);
168 #else 168 #else
169 return NULL; 169 return NULL;
170 #endif 170 #endif
171 } 171 }
172 #endif 172 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/ash/window_positioner_unittest.cc ('k') | chrome/browser/ui/views/extensions/extension_dialog.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698