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 <memory> | 7 #include <memory> |
8 | 8 |
9 #include "base/logging.h" | 9 #include "base/logging.h" |
10 #include "base/single_thread_task_runner.h" | 10 #include "base/single_thread_task_runner.h" |
(...skipping 88 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
99 window_preferences->SetInteger("left", bounds.x()); | 99 window_preferences->SetInteger("left", bounds.x()); |
100 window_preferences->SetInteger("top", bounds.y()); | 100 window_preferences->SetInteger("top", bounds.y()); |
101 window_preferences->SetInteger("right", bounds.right()); | 101 window_preferences->SetInteger("right", bounds.right()); |
102 window_preferences->SetInteger("bottom", bounds.bottom()); | 102 window_preferences->SetInteger("bottom", bounds.bottom()); |
103 window_preferences->SetBoolean("maximized", | 103 window_preferences->SetBoolean("maximized", |
104 show_state == ui::SHOW_STATE_MAXIMIZED); | 104 show_state == ui::SHOW_STATE_MAXIMIZED); |
105 // TODO(afakhry): Remove Docked Windows in M58. | 105 // TODO(afakhry): Remove Docked Windows in M58. |
106 window_preferences->SetBoolean("docked", show_state == ui::SHOW_STATE_DOCKED); | 106 window_preferences->SetBoolean("docked", show_state == ui::SHOW_STATE_DOCKED); |
107 | 107 |
108 gfx::Rect work_area(display::Screen::GetScreen() | 108 gfx::Rect work_area(display::Screen::GetScreen() |
109 ->GetDisplayNearestWindow(window->GetNativeView()) | 109 ->GetDisplayNearestView(window->GetNativeView()) |
110 .work_area()); | 110 .work_area()); |
111 window_preferences->SetInteger("work_area_left", work_area.x()); | 111 window_preferences->SetInteger("work_area_left", work_area.x()); |
112 window_preferences->SetInteger("work_area_top", work_area.y()); | 112 window_preferences->SetInteger("work_area_top", work_area.y()); |
113 window_preferences->SetInteger("work_area_right", work_area.right()); | 113 window_preferences->SetInteger("work_area_right", work_area.right()); |
114 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); | 114 window_preferences->SetInteger("work_area_bottom", work_area.bottom()); |
115 } | 115 } |
116 | 116 |
117 bool ChromeViewsDelegate::GetSavedWindowPlacement( | 117 bool ChromeViewsDelegate::GetSavedWindowPlacement( |
118 const views::Widget* widget, | 118 const views::Widget* widget, |
119 const std::string& window_name, | 119 const std::string& window_name, |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
268 return views::ViewsDelegate::GetDistanceMetric(metric); | 268 return views::ViewsDelegate::GetDistanceMetric(metric); |
269 } | 269 } |
270 | 270 |
271 #if !defined(OS_CHROMEOS) | 271 #if !defined(OS_CHROMEOS) |
272 views::Widget::InitParams::WindowOpacity | 272 views::Widget::InitParams::WindowOpacity |
273 ChromeViewsDelegate::GetOpacityForInitParams( | 273 ChromeViewsDelegate::GetOpacityForInitParams( |
274 const views::Widget::InitParams& params) { | 274 const views::Widget::InitParams& params) { |
275 return views::Widget::InitParams::OPAQUE_WINDOW; | 275 return views::Widget::InitParams::OPAQUE_WINDOW; |
276 } | 276 } |
277 #endif | 277 #endif |
OLD | NEW |