| 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 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 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; | 78 bool docked = false; |
| 79 wp_pref->GetBoolean("docked", &docked); | 79 wp_pref->GetBoolean("docked", &docked); |
| 80 if (*show_state == ui::SHOW_STATE_NORMAL && docked && | 80 if (*show_state == ui::SHOW_STATE_DEFAULT && docked && |
| 81 !browser_->is_type_tabbed() && | 81 !browser_->is_type_tabbed() && |
| 82 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { | 82 browser_->host_desktop_type() == chrome::HOST_DESKTOP_TYPE_ASH) { |
| 83 *show_state = ui::SHOW_STATE_DOCKED; | 83 *show_state = ui::SHOW_STATE_DOCKED; |
| 84 } | 84 } |
| 85 } | 85 } |
| 86 work_area->SetRect(work_area_left, work_area_top, | 86 work_area->SetRect(work_area_left, work_area_top, |
| 87 std::max(0, work_area_right - work_area_left), | 87 std::max(0, work_area_right - work_area_left), |
| 88 std::max(0, work_area_bottom - work_area_top)); | 88 std::max(0, work_area_bottom - work_area_top)); |
| 89 | 89 |
| 90 return has_prefs; | 90 return has_prefs; |
| (...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 442 if (base::CommandLine::ForCurrentProcess()->HasSwitch( | 442 if (base::CommandLine::ForCurrentProcess()->HasSwitch( |
| 443 switches::kStartMaximized)) | 443 switches::kStartMaximized)) |
| 444 return ui::SHOW_STATE_MAXIMIZED; | 444 return ui::SHOW_STATE_MAXIMIZED; |
| 445 | 445 |
| 446 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) | 446 if (browser_->initial_show_state() != ui::SHOW_STATE_DEFAULT) |
| 447 return browser_->initial_show_state(); | 447 return browser_->initial_show_state(); |
| 448 | 448 |
| 449 // Otherwise we use the default which can be overridden later on. | 449 // Otherwise we use the default which can be overridden later on. |
| 450 return ui::SHOW_STATE_DEFAULT; | 450 return ui::SHOW_STATE_DEFAULT; |
| 451 } | 451 } |
| OLD | NEW |