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/prefs/pref_service.h" | 8 #include "base/prefs/pref_service.h" |
9 #include "base/strings/string_util.h" | 9 #include "base/strings/string_util.h" |
10 #include "base/strings/utf_string_conversions.h" | 10 #include "base/strings/utf_string_conversions.h" |
(...skipping 66 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
77 DCHECK(prefs->FindPreference(window_name.c_str())); | 77 DCHECK(prefs->FindPreference(window_name.c_str())); |
78 DictionaryPrefUpdate update(prefs, window_name.c_str()); | 78 DictionaryPrefUpdate update(prefs, window_name.c_str()); |
79 DictionaryValue* window_preferences = update.Get(); | 79 DictionaryValue* window_preferences = update.Get(); |
80 window_preferences->SetInteger("left", bounds.x()); | 80 window_preferences->SetInteger("left", bounds.x()); |
81 window_preferences->SetInteger("top", bounds.y()); | 81 window_preferences->SetInteger("top", bounds.y()); |
82 window_preferences->SetInteger("right", bounds.right()); | 82 window_preferences->SetInteger("right", bounds.right()); |
83 window_preferences->SetInteger("bottom", bounds.bottom()); | 83 window_preferences->SetInteger("bottom", bounds.bottom()); |
84 window_preferences->SetBoolean("maximized", | 84 window_preferences->SetBoolean("maximized", |
85 show_state == ui::SHOW_STATE_MAXIMIZED); | 85 show_state == ui::SHOW_STATE_MAXIMIZED); |
86 gfx::Rect work_area(gfx::Screen::GetScreenFor(window->GetNativeView())-> | 86 gfx::Rect work_area(gfx::Screen::GetScreenFor(window->GetNativeView())-> |
87 GetDisplayMatching(bounds).work_area()); | 87 GetDisplayNearestWindow(window->GetNativeView()).work_area()); |
88 window_preferences->SetInteger("work_area_left", work_area.x()); | 88 window_preferences->SetInteger("work_area_left", work_area.x()); |
89 window_preferences->SetInteger("work_area_top", work_area.y()); | 89 window_preferences->SetInteger("work_area_top", work_area.y()); |
90 window_preferences->SetInteger("work_area_right", work_area.right()); | 90 window_preferences->SetInteger("work_area_right", work_area.right()); |
91 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); | 91 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); |
92 } | 92 } |
93 | 93 |
94 bool ChromeViewsDelegate::GetSavedWindowPlacement( | 94 bool ChromeViewsDelegate::GetSavedWindowPlacement( |
95 const std::string& window_name, | 95 const std::string& window_name, |
96 gfx::Rect* bounds, | 96 gfx::Rect* bounds, |
97 ui::WindowShowState* show_state) const { | 97 ui::WindowShowState* show_state) const { |
(...skipping 179 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
277 } | 277 } |
278 #endif | 278 #endif |
279 } | 279 } |
280 | 280 |
281 #if !defined(OS_CHROMEOS) | 281 #if !defined(OS_CHROMEOS) |
282 base::TimeDelta | 282 base::TimeDelta |
283 ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { | 283 ChromeViewsDelegate::GetDefaultTextfieldObscuredRevealDuration() { |
284 return base::TimeDelta(); | 284 return base::TimeDelta(); |
285 } | 285 } |
286 #endif | 286 #endif |
OLD | NEW |