| Index: chrome/browser/ui/views/frame/browser_view.cc
|
| ===================================================================
|
| --- chrome/browser/ui/views/frame/browser_view.cc (revision 85284)
|
| +++ chrome/browser/ui/views/frame/browser_view.cc (working copy)
|
| @@ -292,7 +292,7 @@
|
| // currently in a window.
|
| views::Window* GetWindow() {
|
| views::Widget* widget = GetWidget();
|
| - return widget ? widget->GetWindow() : NULL;
|
| + return widget ? widget->GetContainingWindow() : NULL;
|
| }
|
|
|
| DISALLOW_COPY_AND_ASSIGN(ResizeCorner);
|
| @@ -579,8 +579,8 @@
|
| BrowserList::SetLastActive(browser());
|
|
|
| // If the window is already visible, just activate it.
|
| - if (frame_->GetWindow()->IsVisible()) {
|
| - frame_->GetWindow()->Activate();
|
| + if (frame_->IsVisible()) {
|
| + frame_->Activate();
|
| return;
|
| }
|
|
|
| @@ -596,13 +596,12 @@
|
| // that should be added and this should be removed.
|
| RestoreFocus();
|
|
|
| - frame_->GetWindow()->Show();
|
| + frame_->Show();
|
| }
|
|
|
| void BrowserView::ShowInactive() {
|
| - views::Window* window = frame_->GetWindow();
|
| - if (!window->IsVisible())
|
| - window->ShowInactive();
|
| + if (!frame_->IsVisible())
|
| + frame_->ShowInactive();
|
| }
|
|
|
| void BrowserView::SetBounds(const gfx::Rect& bounds) {
|
| @@ -613,26 +612,26 @@
|
| void BrowserView::Close() {
|
| BrowserBubbleHost::Close();
|
|
|
| - frame_->GetWindow()->CloseWindow();
|
| + frame_->Close();
|
| }
|
|
|
| void BrowserView::Activate() {
|
| - frame_->GetWindow()->Activate();
|
| + frame_->Activate();
|
| }
|
|
|
| void BrowserView::Deactivate() {
|
| - frame_->GetWindow()->Deactivate();
|
| + frame_->Deactivate();
|
| }
|
|
|
| bool BrowserView::IsActive() const {
|
| - return frame_->GetWindow()->IsActive();
|
| + return frame_->IsActive();
|
| }
|
|
|
| void BrowserView::FlashFrame() {
|
| #if defined(OS_WIN)
|
| FLASHWINFO fwi;
|
| fwi.cbSize = sizeof(fwi);
|
| - fwi.hwnd = frame_->GetWindow()->GetNativeWindow();
|
| + fwi.hwnd = frame_->GetNativeWindow();
|
| fwi.dwFlags = FLASHW_ALL;
|
| fwi.uCount = 4;
|
| fwi.dwTimeout = 0;
|
| @@ -643,7 +642,7 @@
|
| }
|
|
|
| gfx::NativeWindow BrowserView::GetNativeHandle() {
|
| - return GetWidget()->GetWindow()->GetNativeWindow();
|
| + return GetWidget()->GetContainingWindow()->GetNativeWindow();
|
| }
|
|
|
| BrowserWindowTesting* BrowserView::GetBrowserWindowTesting() {
|
| @@ -708,9 +707,9 @@
|
| }
|
|
|
| void BrowserView::UpdateTitleBar() {
|
| - frame_->GetWindow()->UpdateWindowTitle();
|
| + frame_->UpdateWindowTitle();
|
| if (ShouldShowWindowIcon() && !loading_animation_timer_.IsRunning())
|
| - frame_->GetWindow()->UpdateWindowIcon();
|
| + frame_->UpdateWindowIcon();
|
| }
|
|
|
| void BrowserView::ShelfVisibilityChanged() {
|
| @@ -746,15 +745,15 @@
|
| }
|
|
|
| gfx::Rect BrowserView::GetRestoredBounds() const {
|
| - return frame_->GetWindow()->GetNormalBounds();
|
| + return frame_->GetNormalBounds();
|
| }
|
|
|
| gfx::Rect BrowserView::GetBounds() const {
|
| - return frame_->GetWindow()->GetBounds();
|
| + return frame_->GetBounds();
|
| }
|
|
|
| bool BrowserView::IsMaximized() const {
|
| - return frame_->GetWindow()->IsMaximized();
|
| + return frame_->IsMaximized();
|
| }
|
|
|
| void BrowserView::SetFullscreen(bool fullscreen) {
|
| @@ -766,12 +765,12 @@
|
| #else
|
| // On Linux changing fullscreen is async. Ask the window to change it's
|
| // fullscreen state, and when done invoke ProcessFullscreen.
|
| - frame_->GetWindow()->SetFullscreen(fullscreen);
|
| + frame_->SetFullscreen(fullscreen);
|
| #endif
|
| }
|
|
|
| bool BrowserView::IsFullscreen() const {
|
| - return frame_->GetWindow()->IsFullscreen();
|
| + return frame_->IsFullscreen();
|
| }
|
|
|
| bool BrowserView::IsFullscreenBubbleVisible() const {
|
| @@ -979,7 +978,7 @@
|
|
|
| void BrowserView::DisableInactiveFrame() {
|
| #if defined(OS_WIN)
|
| - frame_->GetWindow()->DisableInactiveRendering();
|
| + frame_->DisableInactiveRendering();
|
| #endif // No tricks are needed to get the right behavior on Linux.
|
| }
|
|
|
| @@ -1113,7 +1112,7 @@
|
| }
|
|
|
| void BrowserView::UserChangedTheme() {
|
| - frame_->GetWindow()->FrameTypeChanged();
|
| + frame_->FrameTypeChanged();
|
| }
|
|
|
| int BrowserView::GetExtraRenderViewHeight() const {
|
| @@ -1598,7 +1597,7 @@
|
| bounds->height() + toolbar_->GetPreferredSize().height());
|
| }
|
|
|
| - gfx::Rect window_rect = frame_->GetWindow()->non_client_view()->
|
| + gfx::Rect window_rect = frame_->non_client_view()->
|
| GetWindowBoundsForClientBounds(*bounds);
|
| window_rect.set_origin(bounds->origin());
|
|
|
| @@ -1680,7 +1679,7 @@
|
| // Tab strip isn't empty. Hide the frame (so it appears to have closed
|
| // immediately) and close all the tabs, allowing the renderers to shut
|
| // down. When the tab strip is empty we'll be called back again.
|
| - frame_->GetWindow()->HideWindow();
|
| + frame_->HideWindow();
|
| browser_->OnWindowClosing();
|
| return false;
|
| }
|
| @@ -1688,7 +1687,7 @@
|
| // Empty TabStripModel, it's now safe to allow the Window to be closed.
|
| NotificationService::current()->Notify(
|
| NotificationType::WINDOW_CLOSED,
|
| - Source<gfx::NativeWindow>(frame_->GetWindow()->GetNativeWindow()),
|
| + Source<gfx::NativeWindow>(frame_->GetNativeWindow()),
|
| NotificationService::NoDetails());
|
| return true;
|
| }
|
| @@ -1698,10 +1697,9 @@
|
| // The following code is not in the LayoutManager because it's
|
| // independent of layout and also depends on the ResizeCorner which
|
| // is private.
|
| - if (!frame_->GetWindow()->IsMaximized() &&
|
| - !frame_->GetWindow()->IsFullscreen()) {
|
| + if (!frame_->IsMaximized() && !frame_->IsFullscreen()) {
|
| CRect client_rect;
|
| - ::GetClientRect(frame_->GetWindow()->GetNativeWindow(), &client_rect);
|
| + ::GetClientRect(frame_->GetNativeWindow(), &client_rect);
|
| gfx::Size resize_corner_size = ResizeCorner::GetSize();
|
| gfx::Rect resize_corner_rect(client_rect.right - resize_corner_size.width(),
|
| client_rect.bottom - resize_corner_size.height(),
|
| @@ -1803,8 +1801,7 @@
|
|
|
| SkColor BrowserView::GetInfoBarSeparatorColor() const {
|
| // NOTE: Keep this in sync with ToolbarView::OnPaint()!
|
| - return (IsTabStripVisible() ||
|
| - !frame_->GetWindow()->non_client_view()->UseNativeFrame()) ?
|
| + return (IsTabStripVisible() || !frame_->non_client_view()->UseNativeFrame()) ?
|
| ResourceBundle::toolbar_separator_color : SK_ColorBLACK;
|
| }
|
|
|
| @@ -1934,7 +1931,7 @@
|
|
|
| if (AeroPeekManager::Enabled()) {
|
| aeropeek_manager_.reset(new AeroPeekManager(
|
| - frame_->GetWindow()->GetNativeWindow()));
|
| + frame_->GetNativeWindow()));
|
| browser_->tabstrip_model()->AddObserver(aeropeek_manager_.get());
|
| }
|
| #endif
|
| @@ -2002,7 +1999,7 @@
|
| BuildSystemMenuForAppOrPopupWindow();
|
| system_menu_.reset(
|
| new views::NativeMenuWin(system_menu_contents_.get(),
|
| - frame_->GetWindow()->GetNativeWindow()));
|
| + frame_->GetNativeWindow()));
|
| system_menu_->Rebuild();
|
| }
|
| #endif
|
| @@ -2254,8 +2251,7 @@
|
| #endif
|
| }
|
| #if defined(OS_WIN)
|
| - static_cast<views::WindowWin*>(
|
| - frame_->GetWindow()->native_window())->PushForceHidden();
|
| + static_cast<views::WindowWin*>(frame_->native_window())->PushForceHidden();
|
| #endif
|
|
|
| // Notify bookmark bar, so it can set itself to the appropriate drawing state.
|
| @@ -2264,7 +2260,7 @@
|
|
|
| // Toggle fullscreen mode.
|
| #if defined(OS_WIN)
|
| - frame_->GetWindow()->SetFullscreen(fullscreen);
|
| + frame_->SetFullscreen(fullscreen);
|
| #endif // No need to invoke SetFullscreen for linux as this code is executed
|
| // once we're already fullscreen on linux.
|
|
|
| @@ -2296,8 +2292,7 @@
|
| ignore_layout_ = false;
|
| Layout();
|
| #if defined(OS_WIN)
|
| - static_cast<views::WindowWin*>(
|
| - frame_->GetWindow()->native_window())->PopForceHidden();
|
| + static_cast<views::WindowWin*>(frame_->native_window())->PopForceHidden();
|
| #endif
|
| }
|
|
|
| @@ -2580,11 +2575,9 @@
|
| // Create the view and the frame. The frame will attach itself via the view
|
| // so we don't need to do anything with the pointer.
|
| BrowserView* view = new BrowserView(browser);
|
| - BrowserFrame::Create(view, browser->profile());
|
| -
|
| + (new BrowserFrame(view))->InitBrowserFrame();
|
| view->GetWindow()->non_client_view()->SetAccessibleName(
|
| l10n_util::GetStringUTF16(IDS_PRODUCT_NAME));
|
| -
|
| return view;
|
| }
|
| #endif
|
|
|