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

Side by Side Diff: chrome/browser/chromeos/browser_extenders.cc

Issue 463042: Fixes bug where we wouldn't force a maximized window on Chrome OS... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: Created 11 years 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 | Annotate | Revision Log
« 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) 2009 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2009 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 <algorithm> 5 #include <algorithm>
6 6
7 #include "app/menus/simple_menu_model.h" 7 #include "app/menus/simple_menu_model.h"
8 #include "app/theme_provider.h" 8 #include "app/theme_provider.h"
9 #include "chrome/app/chrome_dll_resource.h" 9 #include "chrome/app/chrome_dll_resource.h"
10 #include "chrome/browser/chromeos/compact_location_bar.h" 10 #include "chrome/browser/chromeos/compact_location_bar.h"
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
85 // The ContextMenuController has to be set to a NonClientView but 85 // The ContextMenuController has to be set to a NonClientView but
86 // not to a NonClientFrameView because a TabStrip is not a child of 86 // not to a NonClientFrameView because a TabStrip is not a child of
87 // a NonClientFrameView even though visually a TabStrip is over a 87 // a NonClientFrameView even though visually a TabStrip is over a
88 // NonClientFrameView. 88 // NonClientFrameView.
89 BrowserFrameGtk* gtk_frame = 89 BrowserFrameGtk* gtk_frame =
90 static_cast<BrowserFrameGtk*>(browser_view()->frame()); 90 static_cast<BrowserFrameGtk*>(browser_view()->frame());
91 gtk_frame->GetNonClientView()->SetContextMenuController(this); 91 gtk_frame->GetNonClientView()->SetContextMenuController(this);
92 92
93 if (browser->type() == Browser::TYPE_NORMAL) { 93 if (browser->type() == Browser::TYPE_NORMAL) {
94 std::string wm_name; 94 std::string wm_name;
95 force_maximized_window_ = x11_util::GetWindowManagerName(&wm_name) && 95 bool wm_name_valid = x11_util::GetWindowManagerName(&wm_name);
96 wm_name == kChromeOsWindowManagerName; 96 // NOTE: On Chrome OS the wm and Chrome are started in parallel. This
97 // means it's possible for us not to be able to get the name of the window
98 // manager. We assume that when this happens we're on Chrome OS.
99 force_maximized_window_ = (!wm_name_valid ||
100 wm_name == kChromeOsWindowManagerName);
97 } 101 }
98 } 102 }
99 103
100 virtual gfx::Rect Layout(const gfx::Rect& bounds) { 104 virtual gfx::Rect Layout(const gfx::Rect& bounds) {
101 // Skip if there is no space to layout, or if the browser is in 105 // Skip if there is no space to layout, or if the browser is in
102 // fullscreen mode. 106 // fullscreen mode.
103 if (bounds.IsEmpty() || browser_view()->IsFullscreen()) { 107 if (bounds.IsEmpty() || browser_view()->IsFullscreen()) {
104 main_menu_->SetVisible(false); 108 main_menu_->SetVisible(false);
105 compact_navigation_bar_->SetVisible(false); 109 compact_navigation_bar_->SetVisible(false);
106 status_area_->SetVisible(false); 110 status_area_->SetVisible(false);
(...skipping 259 matching lines...) Expand 10 before | Expand all | Expand 10 after
366 // static 370 // static
367 BrowserExtender* BrowserExtender::Create(BrowserView* browser_view) { 371 BrowserExtender* BrowserExtender::Create(BrowserView* browser_view) {
368 BrowserExtender* extender; 372 BrowserExtender* extender;
369 if (browser_view->browser()->type() & Browser::TYPE_POPUP) 373 if (browser_view->browser()->type() & Browser::TYPE_POPUP)
370 extender = new PopupExtender(browser_view); 374 extender = new PopupExtender(browser_view);
371 else 375 else
372 extender = new NormalExtender(browser_view); 376 extender = new NormalExtender(browser_view);
373 extender->Init(); 377 extender->Init();
374 return extender; 378 return extender;
375 } 379 }
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