Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(527)

Side by Side Diff: chrome/browser/views/frame/browser_view.cc

Issue 160276: mole expand/collapse API (Closed)
Patch Set: fixed a couple of crashers Created 11 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « chrome/browser/views/extensions/extension_shelf.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 BubbleSet::iterator bubble = browser_bubbles_.begin(); 602 // BrowserWindowClosing will usually cause the bubble to remove itself from
603 for (; bubble != browser_bubbles_.end(); ++bubble) 603 // the set, so we need to iterate in a way that's safe against deletion.
604 for (BubbleSet::iterator i = browser_bubbles_.begin();
605 i != browser_bubbles_.end();) {
606 BubbleSet::iterator bubble = i++;
604 (*bubble)->BrowserWindowClosing(); 607 (*bubble)->BrowserWindowClosing();
608 }
605 609
606 frame_->GetWindow()->Close(); 610 frame_->GetWindow()->Close();
607 } 611 }
608 612
609 void BrowserView::Activate() { 613 void BrowserView::Activate() {
610 frame_->GetWindow()->Activate(); 614 frame_->GetWindow()->Activate();
611 } 615 }
612 616
613 bool BrowserView::IsActive() const { 617 bool BrowserView::IsActive() const {
614 return frame_->GetWindow()->IsActive(); 618 return frame_->GetWindow()->IsActive();
(...skipping 868 matching lines...) Expand 10 before | Expand all | Expand 10 after
1483 views::SingleSplitView::VERTICAL_SPLIT); 1487 views::SingleSplitView::VERTICAL_SPLIT);
1484 SkColor bg_color = GetWidget()->GetThemeProvider()-> 1488 SkColor bg_color = GetWidget()->GetThemeProvider()->
1485 GetColor(BrowserThemeProvider::COLOR_TOOLBAR); 1489 GetColor(BrowserThemeProvider::COLOR_TOOLBAR);
1486 contents_split_->set_background( 1490 contents_split_->set_background(
1487 views::Background::CreateSolidBackground(bg_color)); 1491 views::Background::CreateSolidBackground(bg_color));
1488 AddChildView(contents_split_); 1492 AddChildView(contents_split_);
1489 set_contents_view(contents_split_); 1493 set_contents_view(contents_split_);
1490 1494
1491 status_bubble_.reset(new StatusBubbleViews(GetWidget())); 1495 status_bubble_.reset(new StatusBubbleViews(GetWidget()));
1492 1496
1493 extension_shelf_ = new ExtensionShelf(browser_.get()); 1497 if (browser_->SupportsWindowFeature(Browser::FEATURE_EXTENSIONSHELF)) {
1494 extension_shelf_-> 1498 extension_shelf_ = new ExtensionShelf(browser_.get());
1495 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS)); 1499 extension_shelf_->
1496 AddChildView(extension_shelf_); 1500 SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_EXTENSIONS));
1501 AddChildView(extension_shelf_);
1502 }
1497 1503
1498 #if defined(OS_WIN) 1504 #if defined(OS_WIN)
1499 InitSystemMenu(); 1505 InitSystemMenu();
1500 1506
1501 // Create a custom JumpList and add it to an observer of TabRestoreService 1507 // Create a custom JumpList and add it to an observer of TabRestoreService
1502 // so we can update the custom JumpList when a tab is added or removed. 1508 // so we can update the custom JumpList when a tab is added or removed.
1503 if (JumpList::Enabled()) { 1509 if (JumpList::Enabled()) {
1504 jumplist_.reset(new JumpList); 1510 jumplist_.reset(new JumpList);
1505 jumplist_->AddObserver(browser_->profile()); 1511 jumplist_->AddObserver(browser_->profile());
1506 } 1512 }
(...skipping 429 matching lines...) Expand 10 before | Expand all | Expand 10 after
1936 1942
1937 // static 1943 // static
1938 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 1944 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
1939 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 1945 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
1940 } 1946 }
1941 1947
1942 // static 1948 // static
1943 void BrowserList::AllBrowsersClosed() { 1949 void BrowserList::AllBrowsersClosed() {
1944 views::Window::CloseAllSecondaryWindows(); 1950 views::Window::CloseAllSecondaryWindows();
1945 } 1951 }
OLDNEW
« no previous file with comments | « chrome/browser/views/extensions/extension_shelf.cc ('k') | chrome/chrome.gyp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698