| OLD | NEW |
| 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 Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |