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 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 gfx::Rect work_area( | 77 gfx::Rect work_area( |
78 gfx::Screen::GetMonitorMatching(bounds).work_area()); | 78 gfx::Screen::GetDisplayMatching(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 80 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
169 return NULL; | 169 return NULL; |
170 #endif | 170 #endif |
171 } | 171 } |
172 #endif | 172 #endif |
173 | 173 |
174 content::WebContents* ChromeViewsDelegate::CreateWebContents( | 174 content::WebContents* ChromeViewsDelegate::CreateWebContents( |
175 content::BrowserContext* browser_context, | 175 content::BrowserContext* browser_context, |
176 content::SiteInstance* site_instance) { | 176 content::SiteInstance* site_instance) { |
177 return NULL; | 177 return NULL; |
178 } | 178 } |
OLD | NEW |