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/prefs/scoped_user_pref_update.h" | 9 #include "base/prefs/scoped_user_pref_update.h" |
10 #include "base/strings/string_util.h" | 10 #include "base/strings/string_util.h" |
(...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
153 | 153 |
154 scoped_ptr<DictionaryPrefUpdate> pref_update = | 154 scoped_ptr<DictionaryPrefUpdate> pref_update = |
155 chrome::GetWindowPlacementDictionaryReadWrite(window_name, prefs); | 155 chrome::GetWindowPlacementDictionaryReadWrite(window_name, prefs); |
156 base::DictionaryValue* window_preferences = pref_update->Get(); | 156 base::DictionaryValue* window_preferences = pref_update->Get(); |
157 window_preferences->SetInteger("left", bounds.x()); | 157 window_preferences->SetInteger("left", bounds.x()); |
158 window_preferences->SetInteger("top", bounds.y()); | 158 window_preferences->SetInteger("top", bounds.y()); |
159 window_preferences->SetInteger("right", bounds.right()); | 159 window_preferences->SetInteger("right", bounds.right()); |
160 window_preferences->SetInteger("bottom", bounds.bottom()); | 160 window_preferences->SetInteger("bottom", bounds.bottom()); |
161 window_preferences->SetBoolean("maximized", | 161 window_preferences->SetBoolean("maximized", |
162 show_state == ui::SHOW_STATE_MAXIMIZED); | 162 show_state == ui::SHOW_STATE_MAXIMIZED); |
| 163 window_preferences->SetBoolean("docked", show_state == ui::SHOW_STATE_DOCKED); |
163 gfx::Rect work_area(gfx::Screen::GetScreenFor(window->GetNativeView())-> | 164 gfx::Rect work_area(gfx::Screen::GetScreenFor(window->GetNativeView())-> |
164 GetDisplayNearestWindow(window->GetNativeView()).work_area()); | 165 GetDisplayNearestWindow(window->GetNativeView()).work_area()); |
165 window_preferences->SetInteger("work_area_left", work_area.x()); | 166 window_preferences->SetInteger("work_area_left", work_area.x()); |
166 window_preferences->SetInteger("work_area_top", work_area.y()); | 167 window_preferences->SetInteger("work_area_top", work_area.y()); |
167 window_preferences->SetInteger("work_area_right", work_area.right()); | 168 window_preferences->SetInteger("work_area_right", work_area.right()); |
168 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); | 169 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); |
169 } | 170 } |
170 | 171 |
171 bool ChromeViewsDelegate::GetSavedWindowPlacement( | 172 bool ChromeViewsDelegate::GetSavedWindowPlacement( |
172 const views::Widget* widget, | 173 const views::Widget* widget, |
(...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
434 return content::BrowserThread::GetBlockingPool(); | 435 return content::BrowserThread::GetBlockingPool(); |
435 } | 436 } |
436 | 437 |
437 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) | 438 #if !defined(USE_AURA) && !defined(USE_CHROMEOS) |
438 views::Widget::InitParams::WindowOpacity | 439 views::Widget::InitParams::WindowOpacity |
439 ChromeViewsDelegate::GetOpacityForInitParams( | 440 ChromeViewsDelegate::GetOpacityForInitParams( |
440 const views::Widget::InitParams& params) { | 441 const views::Widget::InitParams& params) { |
441 return views::Widget::InitParams::OPAQUE_WINDOW; | 442 return views::Widget::InitParams::OPAQUE_WINDOW; |
442 } | 443 } |
443 #endif | 444 #endif |
OLD | NEW |