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::GetSavedWindowPlacement( | 452 bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { |
453 gfx::Rect* bounds, | |
454 ui::WindowShowState* show_state) const { | |
455 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame)) { | 453 if (!CommandLine::ForCurrentProcess()->HasSwitch(switches::kChromeosFrame)) { |
456 // Typically we don't request a full screen size. This means we'll request a | 454 // Typically we don't request a full screen size. This means we'll request a |
457 // non-full screen size, layout/paint at that size, then the window manager | 455 // non-full screen size, layout/paint at that size, then the window manager |
458 // will snap us to full screen size. This results in an ugly | 456 // will snap us to full screen size. This results in an ugly |
459 // resize/paint. To avoid this we always request a full screen size. | 457 // resize/paint. To avoid this we always request a full screen size. |
460 *bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( | 458 *bounds = gfx::Screen::GetMonitorWorkAreaNearestWindow( |
461 GTK_WIDGET(GetWidget()->GetNativeWindow())); | 459 GTK_WIDGET(GetWidget()->GetNativeWindow())); |
462 *show_state = ui::SHOW_STATE_NORMAL; | |
463 return true; | 460 return true; |
464 } | 461 } |
465 return ::BrowserView::GetSavedWindowPlacement(bounds, show_state); | 462 return ::BrowserView::GetSavedWindowBounds(bounds); |
466 } | 463 } |
467 | 464 |
468 void BrowserView::Cut() { | 465 void BrowserView::Cut() { |
469 gtk_util::DoCut(this); | 466 gtk_util::DoCut(this); |
470 } | 467 } |
471 | 468 |
472 void BrowserView::Copy() { | 469 void BrowserView::Copy() { |
473 gtk_util::DoCopy(this); | 470 gtk_util::DoCopy(this); |
474 } | 471 } |
475 | 472 |
(...skipping 196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
672 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 669 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
673 // Create a browser view for chromeos. | 670 // Create a browser view for chromeos. |
674 BrowserView* view; | 671 BrowserView* view; |
675 if (browser->is_type_popup() || browser->is_type_panel()) | 672 if (browser->is_type_popup() || browser->is_type_panel()) |
676 view = new chromeos::PanelBrowserView(browser); | 673 view = new chromeos::PanelBrowserView(browser); |
677 else | 674 else |
678 view = new chromeos::BrowserView(browser); | 675 view = new chromeos::BrowserView(browser); |
679 (new BrowserFrame(view))->InitBrowserFrame(); | 676 (new BrowserFrame(view))->InitBrowserFrame(); |
680 return view; | 677 return view; |
681 } | 678 } |
OLD | NEW |