Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(37)

Side by Side Diff: chrome/browser/ui/browser.cc

Issue 9211020: Don't use command line or prefs for popup saved state (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Rebase Created 8 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/browser.h" 5 #include "chrome/browser/ui/browser.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <windows.h> 8 #include <windows.h>
9 #include <shellapi.h> 9 #include <shellapi.h>
10 #endif // OS_WIN 10 #endif // OS_WIN
(...skipping 928 matching lines...) Expand 10 before | Expand all | Expand 10 after
939 return gfx::Rect(0, 0, 800, 600); 939 return gfx::Rect(0, 0, 800, 600);
940 } 940 }
941 941
942 gfx::Rect restored_bounds = override_bounds_; 942 gfx::Rect restored_bounds = override_bounds_;
943 WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this, 943 WindowSizer::GetBrowserWindowBounds(app_name_, restored_bounds, this,
944 &restored_bounds); 944 &restored_bounds);
945 return restored_bounds; 945 return restored_bounds;
946 } 946 }
947 947
948 ui::WindowShowState Browser::GetSavedWindowShowState() const { 948 ui::WindowShowState Browser::GetSavedWindowShowState() const {
949 // Only tabbed browsers use the command line or preference state.
950 if (!is_type_tabbed()) {
951 return (show_state_ == ui::SHOW_STATE_DEFAULT)
952 ? ui::SHOW_STATE_NORMAL : show_state_;
953 }
954
949 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized)) 955 if (CommandLine::ForCurrentProcess()->HasSwitch(switches::kStartMaximized))
950 return ui::SHOW_STATE_MAXIMIZED; 956 return ui::SHOW_STATE_MAXIMIZED;
951 957
952 if (show_state_ != ui::SHOW_STATE_DEFAULT) 958 if (show_state_ != ui::SHOW_STATE_DEFAULT)
953 return show_state_; 959 return show_state_;
954 960
955 const DictionaryValue* window_pref = 961 const DictionaryValue* window_pref =
956 profile()->GetPrefs()->GetDictionary(GetWindowPlacementKey().c_str()); 962 profile()->GetPrefs()->GetDictionary(GetWindowPlacementKey().c_str());
957 bool maximized = false; 963 bool maximized = false;
958 window_pref->GetBoolean("maximized", &maximized); 964 window_pref->GetBoolean("maximized", &maximized);
(...skipping 4510 matching lines...) Expand 10 before | Expand all | Expand 10 after
5469 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false); 5475 local_state->SetBoolean(prefs::kShouldShowFirstRunBubble, false);
5470 window_->GetLocationBar()->ShowFirstRunBubble(); 5476 window_->GetLocationBar()->ShowFirstRunBubble();
5471 } else { 5477 } else {
5472 GlobalErrorService* service = 5478 GlobalErrorService* service =
5473 GlobalErrorServiceFactory::GetForProfile(profile()); 5479 GlobalErrorServiceFactory::GetForProfile(profile());
5474 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView(); 5480 GlobalError* error = service->GetFirstGlobalErrorWithBubbleView();
5475 if (error) 5481 if (error)
5476 error->ShowBubbleView(this); 5482 error->ShowBubbleView(this);
5477 } 5483 }
5478 } 5484 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698