OLD | NEW |
1 // Copyright (c) 2006-2009 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-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 "chrome/browser/views/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
6 | 6 |
7 #include "app/drag_drop_types.h" | 7 #include "app/drag_drop_types.h" |
8 #include "app/gfx/canvas.h" | 8 #include "app/gfx/canvas.h" |
9 #include "app/l10n_util.h" | 9 #include "app/l10n_util.h" |
10 #include "app/os_exchange_data.h" | 10 #include "app/os_exchange_data.h" |
(...skipping 581 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
592 contents_split_->set_divider_offset(split_offset); | 592 contents_split_->set_divider_offset(split_offset); |
593 | 593 |
594 frame_->GetWindow()->Show(); | 594 frame_->GetWindow()->Show(); |
595 } | 595 } |
596 | 596 |
597 void BrowserView::SetBounds(const gfx::Rect& bounds) { | 597 void BrowserView::SetBounds(const gfx::Rect& bounds) { |
598 GetWidget()->SetBounds(bounds); | 598 GetWidget()->SetBounds(bounds); |
599 } | 599 } |
600 | 600 |
601 void BrowserView::Close() { | 601 void BrowserView::Close() { |
602 // BrowserWindowClosing will usually cause the bubble to remove itself from | 602 BubbleSet::iterator bubble = browser_bubbles_.begin(); |
603 // the set, so we need to iterate in a way that's safe against deletion. | 603 for (; bubble != browser_bubbles_.end(); ++bubble) |
604 for (BubbleSet::iterator i = browser_bubbles_.begin(); | |
605 i != browser_bubbles_.end();) { | |
606 BubbleSet::iterator bubble = i++; | |
607 (*bubble)->BrowserWindowClosing(); | 604 (*bubble)->BrowserWindowClosing(); |
608 } | |
609 | 605 |
610 frame_->GetWindow()->Close(); | 606 frame_->GetWindow()->Close(); |
611 } | 607 } |
612 | 608 |
613 void BrowserView::Activate() { | 609 void BrowserView::Activate() { |
614 frame_->GetWindow()->Activate(); | 610 frame_->GetWindow()->Activate(); |
615 } | 611 } |
616 | 612 |
617 bool BrowserView::IsActive() const { | 613 bool BrowserView::IsActive() const { |
618 return frame_->GetWindow()->IsActive(); | 614 return frame_->GetWindow()->IsActive(); |
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1487 views::SingleSplitView::VERTICAL_SPLIT); | 1483 views::SingleSplitView::VERTICAL_SPLIT); |
1488 SkColor bg_color = GetWidget()->GetThemeProvider()-> | 1484 SkColor bg_color = GetWidget()->GetThemeProvider()-> |
1489 GetColor(BrowserThemeProvider::COLOR_TOOLBAR); | 1485 GetColor(BrowserThemeProvider::COLOR_TOOLBAR); |
1490 contents_split_->set_background( | 1486 contents_split_->set_background( |
1491 views::Background::CreateSolidBackground(bg_color)); | 1487 views::Background::CreateSolidBackground(bg_color)); |
1492 AddChildView(contents_split_); | 1488 AddChildView(contents_split_); |
1493 set_contents_view(contents_split_); | 1489 set_contents_view(contents_split_); |
1494 | 1490 |
1495 status_bubble_.reset(new StatusBubbleViews(GetWidget())); | 1491 status_bubble_.reset(new StatusBubbleViews(GetWidget())); |
1496 | 1492 |
1497 if (browser_->SupportsWindowFeature(Browser::FEATURE_EXTENSIONSHELF)) { | 1493 extension_shelf_ = new ExtensionShelf(browser_.get()); |
1498 extension_shelf_ = new ExtensionShelf(browser_.get()); | 1494 extension_shelf_-> |
1499 extension_shelf_-> | 1495 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS)); |
1500 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS)); | 1496 AddChildView(extension_shelf_); |
1501 AddChildView(extension_shelf_); | |
1502 } | |
1503 | 1497 |
1504 #if defined(OS_WIN) | 1498 #if defined(OS_WIN) |
1505 InitSystemMenu(); | 1499 InitSystemMenu(); |
1506 | 1500 |
1507 // Create a custom JumpList and add it to an observer of TabRestoreService | 1501 // Create a custom JumpList and add it to an observer of TabRestoreService |
1508 // so we can update the custom JumpList when a tab is added or removed. | 1502 // so we can update the custom JumpList when a tab is added or removed. |
1509 if (JumpList::Enabled()) { | 1503 if (JumpList::Enabled()) { |
1510 jumplist_.reset(new JumpList); | 1504 jumplist_.reset(new JumpList); |
1511 jumplist_->AddObserver(browser_->profile()); | 1505 jumplist_->AddObserver(browser_->profile()); |
1512 } | 1506 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1942 | 1936 |
1943 // static | 1937 // static |
1944 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1938 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
1945 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 1939 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
1946 } | 1940 } |
1947 | 1941 |
1948 // static | 1942 // static |
1949 void BrowserList::AllBrowsersClosed() { | 1943 void BrowserList::AllBrowsersClosed() { |
1950 views::Window::CloseAllSecondaryWindows(); | 1944 views::Window::CloseAllSecondaryWindows(); |
1951 } | 1945 } |
OLD | NEW |