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/window_sizer/window_sizer.h" | 5 #include "chrome/browser/ui/window_sizer/window_sizer.h" |
6 | 6 |
7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
8 #include "base/compiler_specific.h" | 8 #include "base/compiler_specific.h" |
9 #include "base/prefs/pref_service.h" | 9 #include "base/prefs/pref_service.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 int work_area_left = 0; | 68 int work_area_left = 0; |
69 int work_area_bottom = 0; | 69 int work_area_bottom = 0; |
70 int work_area_right = 0; | 70 int work_area_right = 0; |
71 if (wp_pref) { | 71 if (wp_pref) { |
72 wp_pref->GetInteger("work_area_top", &work_area_top); | 72 wp_pref->GetInteger("work_area_top", &work_area_top); |
73 wp_pref->GetInteger("work_area_left", &work_area_left); | 73 wp_pref->GetInteger("work_area_left", &work_area_left); |
74 wp_pref->GetInteger("work_area_bottom", &work_area_bottom); | 74 wp_pref->GetInteger("work_area_bottom", &work_area_bottom); |
75 wp_pref->GetInteger("work_area_right", &work_area_right); | 75 wp_pref->GetInteger("work_area_right", &work_area_right); |
76 if (*show_state == ui::SHOW_STATE_DEFAULT && maximized) | 76 if (*show_state == ui::SHOW_STATE_DEFAULT && maximized) |
77 *show_state = ui::SHOW_STATE_MAXIMIZED; | 77 *show_state = ui::SHOW_STATE_MAXIMIZED; |
| 78 bool docked = false; |
| 79 wp_pref->GetBoolean("docked", &docked); |
| 80 if (*show_state == ui::SHOW_STATE_NORMAL && docked && |
| 81 !browser_->is_type_tabbed() && |
| 82 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { |
| 83 *show_state = ui::SHOW_STATE_DOCKED; |
| 84 } |
78 } | 85 } |
79 work_area->SetRect(work_area_left, work_area_top, | 86 work_area->SetRect(work_area_left, work_area_top, |
80 std::max(0, work_area_right - work_area_left), | 87 std::max(0, work_area_right - work_area_left), |
81 std::max(0, work_area_bottom - work_area_top)); | 88 std::max(0, work_area_bottom - work_area_top)); |
82 | 89 |
83 return has_prefs; | 90 return has_prefs; |
84 } | 91 } |
85 | 92 |
86 bool GetLastActiveWindowState( | 93 bool GetLastActiveWindowState( |
87 gfx::Rect* bounds, | 94 gfx::Rect* bounds, |
(...skipping 347 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
435 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 442 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
436 switches::kStartMaximized)) | 443 switches::kStartMaximized)) |
437 return ui::SHOW_STATE_MAXIMIZED; | 444 return ui::SHOW_STATE_MAXIMIZED; |
438 | 445 |
439 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) | 446 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) |
440 return browser_->initial_show_state(); | 447 return browser_->initial_show_state(); |
441 | 448 |
442 // Otherwise we use the default which can be overridden later on. | 449 // Otherwise we use the default which can be overridden later on. |
443 return ui::SHOW_STATE_DEFAULT; | 450 return ui::SHOW_STATE_DEFAULT; |
444 } | 451 } |
OLD | NEW |