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 #if defined(OS_LINUX) | 7 #if defined(OS_LINUX) |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 #endif | 9 #endif |
10 | 10 |
(...skipping 584 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
595 contents_split_->set_divider_offset(split_offset); | 595 contents_split_->set_divider_offset(split_offset); |
596 | 596 |
597 frame_->GetWindow()->Show(); | 597 frame_->GetWindow()->Show(); |
598 } | 598 } |
599 | 599 |
600 void BrowserView::SetBounds(const gfx::Rect& bounds) { | 600 void BrowserView::SetBounds(const gfx::Rect& bounds) { |
601 GetWidget()->SetBounds(bounds); | 601 GetWidget()->SetBounds(bounds); |
602 } | 602 } |
603 | 603 |
604 void BrowserView::Close() { | 604 void BrowserView::Close() { |
605 BubbleSet::iterator bubble = browser_bubbles_.begin(); | 605 // Make a copy, since the typical behavior is to detach and delete in this |
606 for (; bubble != browser_bubbles_.end(); ++bubble) | 606 // case. Otherwise, the iterator would become invalid. |
| 607 BubbleSet copy = BubbleSet(browser_bubbles_.begin(), browser_bubbles_.end()); |
| 608 BubbleSet::iterator bubble = copy.begin(); |
| 609 for (; bubble != copy.end(); ++bubble) |
607 (*bubble)->BrowserWindowClosing(); | 610 (*bubble)->BrowserWindowClosing(); |
608 | 611 |
609 frame_->GetWindow()->Close(); | 612 frame_->GetWindow()->Close(); |
610 } | 613 } |
611 | 614 |
612 void BrowserView::Activate() { | 615 void BrowserView::Activate() { |
613 frame_->GetWindow()->Activate(); | 616 frame_->GetWindow()->Activate(); |
614 } | 617 } |
615 | 618 |
616 bool BrowserView::IsActive() const { | 619 bool BrowserView::IsActive() const { |
(...skipping 852 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1469 views::SingleSplitView::VERTICAL_SPLIT); | 1472 views::SingleSplitView::VERTICAL_SPLIT); |
1470 SkColor bg_color = GetWidget()->GetThemeProvider()-> | 1473 SkColor bg_color = GetWidget()->GetThemeProvider()-> |
1471 GetColor(BrowserThemeProvider::COLOR_TOOLBAR); | 1474 GetColor(BrowserThemeProvider::COLOR_TOOLBAR); |
1472 contents_split_->set_background( | 1475 contents_split_->set_background( |
1473 views::Background::CreateSolidBackground(bg_color)); | 1476 views::Background::CreateSolidBackground(bg_color)); |
1474 AddChildView(contents_split_); | 1477 AddChildView(contents_split_); |
1475 set_contents_view(contents_split_); | 1478 set_contents_view(contents_split_); |
1476 | 1479 |
1477 status_bubble_.reset(new StatusBubbleViews(GetWidget())); | 1480 status_bubble_.reset(new StatusBubbleViews(GetWidget())); |
1478 | 1481 |
1479 extension_shelf_ = new ExtensionShelf(browser_.get()); | 1482 if (browser_->SupportsWindowFeature(Browser::FEATURE_EXTENSIONSHELF)) { |
1480 extension_shelf_-> | 1483 extension_shelf_ = new ExtensionShelf(browser_.get()); |
1481 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS)); | 1484 extension_shelf_-> |
1482 AddChildView(extension_shelf_); | 1485 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS)); |
| 1486 AddChildView(extension_shelf_); |
| 1487 } |
1483 | 1488 |
1484 #if defined(OS_WIN) | 1489 #if defined(OS_WIN) |
1485 InitSystemMenu(); | 1490 InitSystemMenu(); |
1486 | 1491 |
1487 // Create a custom JumpList and add it to an observer of TabRestoreService | 1492 // Create a custom JumpList and add it to an observer of TabRestoreService |
1488 // so we can update the custom JumpList when a tab is added or removed. | 1493 // so we can update the custom JumpList when a tab is added or removed. |
1489 if (JumpList::Enabled()) { | 1494 if (JumpList::Enabled()) { |
1490 jumplist_.reset(new JumpList); | 1495 jumplist_.reset(new JumpList); |
1491 jumplist_->AddObserver(browser_->profile()); | 1496 jumplist_->AddObserver(browser_->profile()); |
1492 } | 1497 } |
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 | 1927 |
1923 // static | 1928 // static |
1924 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { | 1929 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { |
1925 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); | 1930 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); |
1926 } | 1931 } |
1927 | 1932 |
1928 // static | 1933 // static |
1929 void BrowserList::AllBrowsersClosed() { | 1934 void BrowserList::AllBrowsersClosed() { |
1930 views::Window::CloseAllSecondaryWindows(); | 1935 views::Window::CloseAllSecondaryWindows(); |
1931 } | 1936 } |
OLD | NEW |