OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/chromeos/frame/browser_view.h" | 5 #include "chrome/browser/chromeos/frame/browser_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 #include <set> | 8 #include <set> |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 431 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
442 } | 442 } |
443 | 443 |
444 views::LayoutManager* BrowserView::CreateLayoutManager() const { | 444 views::LayoutManager* BrowserView::CreateLayoutManager() const { |
445 return new BrowserViewLayout(); | 445 return new BrowserViewLayout(); |
446 } | 446 } |
447 | 447 |
448 void BrowserView::ChildPreferredSizeChanged(View* child) { | 448 void BrowserView::ChildPreferredSizeChanged(View* child) { |
449 Layout(); | 449 Layout(); |
450 } | 450 } |
451 | 451 |
452 bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { | 452 bool BrowserView::GetSavedWindowPlacement( |
| 453 gfx::Rect* bounds, |
| 454 ui::WindowShowState* show_state) const { |
453 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame)) { | 455 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame)) { |
454 // Typically we don't request a full screen size. This means we'll request a | 456 // Typically we don't request a full screen size. This means we'll request a |
455 // non-full screen size, layout/paint at that size, then the window manager | 457 // non-full screen size, layout/paint at that size, then the window manager |
456 // will snap us to full screen size. This results in an ugly | 458 // will snap us to full screen size. This results in an ugly |
457 // resize/paint. To avoid this we always request a full screen size. | 459 // resize/paint. To avoid this we always request a full screen size. |
458 *bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( | 460 *bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( |
459 GTK_WIDGET(GetWidget()->GetNativeWindow())); | 461 GTK_WIDGET(GetWidget()->GetNativeWindow())); |
| 462 *show_state = ui::SHOW_STATE_NORMAL; |
460 return true; | 463 return true; |
461 } | 464 } |
462 return ::BrowserView::GetSavedWindowBounds(bounds); | 465 return ::BrowserView::GetSavedWindowPlacement(bounds, show_state); |
463 } | 466 } |
464 | 467 |
465 void BrowserView::Cut() { | 468 void BrowserView::Cut() { |
466 gtk_util::DoCut(this); | 469 gtk_util::DoCut(this); |
467 } | 470 } |
468 | 471 |
469 void BrowserView::Copy() { | 472 void BrowserView::Copy() { |
470 gtk_util::DoCopy(this); | 473 gtk_util::DoCopy(this); |
471 } | 474 } |
472 | 475 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
669 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 672 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
670 // Create a browser view for chromeos. | 673 // Create a browser view for chromeos. |
671 BrowserView* view; | 674 BrowserView* view; |
672 if (browser->is_type_popup() || browser->is_type_panel()) | 675 if (browser->is_type_popup() || browser->is_type_panel()) |
673 view = new chromeos::PanelBrowserView(browser); | 676 view = new chromeos::PanelBrowserView(browser); |
674 else | 677 else |
675 view = new chromeos::BrowserView(browser); | 678 view = new chromeos::BrowserView(browser); |
676 (new BrowserFrame(view))->InitBrowserFrame(); | 679 (new BrowserFrame(view))->InitBrowserFrame(); |
677 return view; | 680 return view; |
678 } | 681 } |
OLD | NEW |