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

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

Issue 151150: Add split with devtools container into the browser view. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | webkit/glue/devtools/js/devtools.css » ('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 #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
11 #include "app/drag_drop_types.h" 11 #include "app/drag_drop_types.h"
12 #include "app/gfx/canvas.h" 12 #include "app/gfx/canvas.h"
13 #include "app/l10n_util.h" 13 #include "app/l10n_util.h"
14 #include "app/os_exchange_data.h" 14 #include "app/os_exchange_data.h"
15 #include "app/resource_bundle.h" 15 #include "app/resource_bundle.h"
16 #include "base/command_line.h" 16 #include "base/command_line.h"
17 #include "base/time.h" 17 #include "base/time.h"
18 #include "build/build_config.h" 18 #include "build/build_config.h"
19 #include "chrome/app/chrome_dll_resource.h" 19 #include "chrome/app/chrome_dll_resource.h"
20 #include "chrome/browser/app_modal_dialog_queue.h" 20 #include "chrome/browser/app_modal_dialog_queue.h"
21 #include "chrome/browser/bookmarks/bookmark_utils.h" 21 #include "chrome/browser/bookmarks/bookmark_utils.h"
22 #include "chrome/browser/browser.h" 22 #include "chrome/browser/browser.h"
23 #include "chrome/browser/browser_list.h" 23 #include "chrome/browser/browser_list.h"
24 #include "chrome/browser/browser_process.h" 24 #include "chrome/browser/browser_process.h"
25 #include "chrome/browser/debugger/devtools_window.h"
25 #include "chrome/browser/download/download_manager.h" 26 #include "chrome/browser/download/download_manager.h"
26 #include "chrome/browser/find_bar.h" 27 #include "chrome/browser/find_bar.h"
27 #include "chrome/browser/find_bar_controller.h" 28 #include "chrome/browser/find_bar_controller.h"
28 #include "chrome/browser/profile.h" 29 #include "chrome/browser/profile.h"
29 #include "chrome/browser/view_ids.h" 30 #include "chrome/browser/view_ids.h"
30 #include "chrome/browser/views/bookmark_bar_view.h" 31 #include "chrome/browser/views/bookmark_bar_view.h"
31 #include "chrome/browser/views/browser_bubble.h" 32 #include "chrome/browser/views/browser_bubble.h"
32 #include "chrome/browser/views/browser_dialogs.h" 33 #include "chrome/browser/views/browser_dialogs.h"
33 #include "chrome/browser/views/chrome_views_delegate.h" 34 #include "chrome/browser/views/chrome_views_delegate.h"
34 #include "chrome/browser/views/download_shelf_view.h" 35 #include "chrome/browser/views/download_shelf_view.h"
(...skipping 17 matching lines...) Expand all
52 #include "chrome/common/pref_names.h" 53 #include "chrome/common/pref_names.h"
53 #include "chrome/common/pref_service.h" 54 #include "chrome/common/pref_service.h"
54 #include "grit/app_resources.h" 55 #include "grit/app_resources.h"
55 #include "grit/chromium_strings.h" 56 #include "grit/chromium_strings.h"
56 #include "grit/generated_resources.h" 57 #include "grit/generated_resources.h"
57 #include "grit/theme_resources.h" 58 #include "grit/theme_resources.h"
58 #include "grit/webkit_resources.h" 59 #include "grit/webkit_resources.h"
59 #if defined(OS_WIN) 60 #if defined(OS_WIN)
60 #include "views/controls/scrollbar/native_scroll_bar.h" 61 #include "views/controls/scrollbar/native_scroll_bar.h"
61 #endif 62 #endif
63 #include "views/controls/single_split_view.h"
62 #include "views/fill_layout.h" 64 #include "views/fill_layout.h"
63 #include "views/view.h" 65 #include "views/view.h"
64 #include "views/widget/root_view.h" 66 #include "views/widget/root_view.h"
65 #include "views/window/dialog_delegate.h" 67 #include "views/window/dialog_delegate.h"
66 #if !defined(OS_WIN) 68 #if !defined(OS_WIN)
67 #include "views/window/hit_test.h" 69 #include "views/window/hit_test.h"
68 #endif 70 #endif
69 #include "views/window/non_client_view.h" 71 #include "views/window/non_client_view.h"
70 #include "views/window/window.h" 72 #include "views/window/window.h"
71 73
(...skipping 198 matching lines...) Expand 10 before | Expand all | Expand 10 after
270 BrowserView::BrowserView(Browser* browser) 272 BrowserView::BrowserView(Browser* browser)
271 : views::ClientView(NULL, NULL), 273 : views::ClientView(NULL, NULL),
272 frame_(NULL), 274 frame_(NULL),
273 browser_(browser), 275 browser_(browser),
274 active_bookmark_bar_(NULL), 276 active_bookmark_bar_(NULL),
275 tabstrip_(NULL), 277 tabstrip_(NULL),
276 toolbar_(NULL), 278 toolbar_(NULL),
277 infobar_container_(NULL), 279 infobar_container_(NULL),
278 find_bar_y_(0), 280 find_bar_y_(0),
279 contents_container_(NULL), 281 contents_container_(NULL),
282 devtools_container_(NULL),
283 contents_split_(NULL),
280 initialized_(false), 284 initialized_(false),
281 ignore_layout_(false), 285 ignore_layout_(false),
282 #if defined(OS_WIN) 286 #if defined(OS_WIN)
283 hung_window_detector_(&hung_plugin_action_), 287 hung_window_detector_(&hung_plugin_action_),
284 ticker_(0), 288 ticker_(0),
285 #endif 289 #endif
286 extension_shelf_(NULL) { 290 extension_shelf_(NULL) {
287 InitClass(); 291 InitClass();
288 browser_->tabstrip_model()->AddObserver(this); 292 browser_->tabstrip_model()->AddObserver(this);
289 } 293 }
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
527 system_menu_->UpdateStates(); 531 system_menu_->UpdateStates();
528 } 532 }
529 #endif 533 #endif
530 534
531 // static 535 // static
532 void BrowserView::RegisterBrowserViewPrefs(PrefService* prefs) { 536 void BrowserView::RegisterBrowserViewPrefs(PrefService* prefs) {
533 prefs->RegisterIntegerPref(prefs::kPluginMessageResponseTimeout, 537 prefs->RegisterIntegerPref(prefs::kPluginMessageResponseTimeout,
534 kDefaultPluginMessageResponseTimeout); 538 kDefaultPluginMessageResponseTimeout);
535 prefs->RegisterIntegerPref(prefs::kHungPluginDetectFrequency, 539 prefs->RegisterIntegerPref(prefs::kHungPluginDetectFrequency,
536 kDefaultHungPluginDetectFrequency); 540 kDefaultHungPluginDetectFrequency);
541 prefs->RegisterIntegerPref(prefs::kDevToolsSplitLocation, -1);
537 } 542 }
538 543
539 void BrowserView::AttachBrowserBubble(BrowserBubble* bubble) { 544 void BrowserView::AttachBrowserBubble(BrowserBubble* bubble) {
540 browser_bubbles_.insert(bubble); 545 browser_bubbles_.insert(bubble);
541 } 546 }
542 547
543 void BrowserView::DetachBrowserBubble(BrowserBubble* bubble) { 548 void BrowserView::DetachBrowserBubble(BrowserBubble* bubble) {
544 BubbleSet::iterator it = browser_bubbles_.find(bubble); 549 BubbleSet::iterator it = browser_bubbles_.find(bubble);
545 if (it != browser_bubbles_.end()) 550 if (it != browser_bubbles_.end())
546 browser_bubbles_.erase(it); 551 browser_bubbles_.erase(it);
(...skipping 16 matching lines...) Expand all
563 // but I think initializing is the only time where this can happen where 568 // but I think initializing is the only time where this can happen where
564 // there is some focus change we need to pick up, and this is easier than 569 // there is some focus change we need to pick up, and this is easier than
565 // plumbing through an un-hide message all the way from the frame. 570 // plumbing through an un-hide message all the way from the frame.
566 // 571 //
567 // If we do find there are cases where we need to restore the focus on show, 572 // If we do find there are cases where we need to restore the focus on show,
568 // that should be added and this should be removed. 573 // that should be added and this should be removed.
569 TabContents* selected_tab_contents = GetSelectedTabContents(); 574 TabContents* selected_tab_contents = GetSelectedTabContents();
570 if (selected_tab_contents) 575 if (selected_tab_contents)
571 selected_tab_contents->view()->RestoreFocus(); 576 selected_tab_contents->view()->RestoreFocus();
572 577
578 // Restore split offset.
579 int split_offset = g_browser_process->local_state()->GetInteger(
580 prefs::kDevToolsSplitLocation);
581 if (split_offset == -1) {
582 // Initial load, set to default value.
583 split_offset = 2 * contents_split_->height() / 3;
584 }
585 // Make sure user can see both panes.
586 int min_split_size = contents_split_->height() / 10;
587 split_offset = std::min(contents_split_->height() - min_split_size,
588 std::max(min_split_size, split_offset));
589 contents_split_->set_divider_offset(split_offset);
590
573 frame_->GetWindow()->Show(); 591 frame_->GetWindow()->Show();
574 } 592 }
575 593
576 void BrowserView::SetBounds(const gfx::Rect& bounds) { 594 void BrowserView::SetBounds(const gfx::Rect& bounds) {
577 GetWidget()->SetBounds(bounds); 595 GetWidget()->SetBounds(bounds);
578 } 596 }
579 597
580 void BrowserView::Close() { 598 void BrowserView::Close() {
581 frame_->GetWindow()->Close(); 599 frame_->GetWindow()->Close();
582 600
583 BubbleSet::iterator bubble = browser_bubbles_.begin(); 601 BubbleSet::iterator bubble = browser_bubbles_.begin();
584 for (; bubble != browser_bubbles_.end(); ++bubble) { 602 for (; bubble != browser_bubbles_.end(); ++bubble) {
585 (*bubble)->BrowserWindowClosed(); 603 (*bubble)->BrowserWindowClosed();
586 } 604 }
605
606 g_browser_process->local_state()->SetInteger(
607 prefs::kDevToolsSplitLocation, contents_split_->divider_offset());
587 } 608 }
588 609
589 void BrowserView::Activate() { 610 void BrowserView::Activate() {
590 frame_->GetWindow()->Activate(); 611 frame_->GetWindow()->Activate();
591 } 612 }
592 613
593 bool BrowserView::IsActive() const { 614 bool BrowserView::IsActive() const {
594 return frame_->GetWindow()->IsActive(); 615 return frame_->GetWindow()->IsActive();
595 } 616 }
596 617
(...skipping 27 matching lines...) Expand all
624 #endif 645 #endif
625 } 646 }
626 647
627 void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) { 648 void BrowserView::SelectedTabToolbarSizeChanged(bool is_animating) {
628 if (is_animating) { 649 if (is_animating) {
629 contents_container_->SetFastResize(true); 650 contents_container_->SetFastResize(true);
630 UpdateUIForContents(browser_->GetSelectedTabContents()); 651 UpdateUIForContents(browser_->GetSelectedTabContents());
631 contents_container_->SetFastResize(false); 652 contents_container_->SetFastResize(false);
632 } else { 653 } else {
633 UpdateUIForContents(browser_->GetSelectedTabContents()); 654 UpdateUIForContents(browser_->GetSelectedTabContents());
634 contents_container_->Layout(); 655 contents_split_->Layout();
635 } 656 }
636 } 657 }
637 658
638 void BrowserView::UpdateTitleBar() { 659 void BrowserView::UpdateTitleBar() {
639 frame_->GetWindow()->UpdateWindowTitle(); 660 frame_->GetWindow()->UpdateWindowTitle();
640 if (ShouldShowWindowIcon()) 661 if (ShouldShowWindowIcon())
641 frame_->GetWindow()->UpdateWindowIcon(); 662 frame_->GetWindow()->UpdateWindowIcon();
642 } 663 }
643 664
644 void BrowserView::UpdateDevTools() { 665 void BrowserView::UpdateDevTools() {
645 NOTIMPLEMENTED(); 666 UpdateDevToolsForContents(GetSelectedTabContents());
667 Layout();
646 } 668 }
647 669
648 void BrowserView::UpdateLoadingAnimations(bool should_animate) { 670 void BrowserView::UpdateLoadingAnimations(bool should_animate) {
649 if (should_animate) { 671 if (should_animate) {
650 if (!loading_animation_timer_.IsRunning()) { 672 if (!loading_animation_timer_.IsRunning()) {
651 // Loads are happening, and the timer isn't running, so start it. 673 // Loads are happening, and the timer isn't running, so start it.
652 loading_animation_timer_.Start( 674 loading_animation_timer_.Start(
653 TimeDelta::FromMilliseconds(kLoadingAnimationFrameTimeMs), this, 675 TimeDelta::FromMilliseconds(kLoadingAnimationFrameTimeMs), this,
654 &BrowserView::LoadingAnimationCallback); 676 &BrowserView::LoadingAnimationCallback);
655 } 677 }
(...skipping 137 matching lines...) Expand 10 before | Expand all | Expand 10 after
793 815
794 // We don't specify a resize corner size if we have a bottom shelf either. 816 // We don't specify a resize corner size if we have a bottom shelf either.
795 // This is because we take care of drawing the resize corner on top of that 817 // This is because we take care of drawing the resize corner on top of that
796 // shelf, so we don't want others to do it for us in this case. 818 // shelf, so we don't want others to do it for us in this case.
797 // Currently, the only visible bottom shelf is the download shelf. 819 // Currently, the only visible bottom shelf is the download shelf.
798 // Other tests should be added here if we add more bottom shelves. 820 // Other tests should be added here if we add more bottom shelves.
799 if (download_shelf_.get() && download_shelf_->IsShowing()) { 821 if (download_shelf_.get() && download_shelf_->IsShowing()) {
800 return gfx::Rect(); 822 return gfx::Rect();
801 } 823 }
802 824
803 gfx::Rect client_rect = contents_container_->bounds(); 825 gfx::Rect client_rect = contents_split_->bounds();
804 gfx::Size resize_corner_size = ResizeCorner::GetSize(); 826 gfx::Size resize_corner_size = ResizeCorner::GetSize();
805 int x = client_rect.width() - resize_corner_size.width(); 827 int x = client_rect.width() - resize_corner_size.width();
806 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT) 828 if (l10n_util::GetTextDirection() == l10n_util::RIGHT_TO_LEFT)
807 x = 0; 829 x = 0;
808 return gfx::Rect(x, client_rect.height() - resize_corner_size.height(), 830 return gfx::Rect(x, client_rect.height() - resize_corner_size.height(),
809 resize_corner_size.width(), resize_corner_size.height()); 831 resize_corner_size.width(), resize_corner_size.height());
810 } 832 }
811 833
812 void BrowserView::DisableInactiveFrame() { 834 void BrowserView::DisableInactiveFrame() {
813 frame_->GetWindow()->DisableInactiveRendering(); 835 frame_->GetWindow()->DisableInactiveRendering();
(...skipping 158 matching lines...) Expand 10 before | Expand all | Expand 10 after
972 void BrowserView::TabDetachedAt(TabContents* contents, int index) { 994 void BrowserView::TabDetachedAt(TabContents* contents, int index) {
973 // We use index here rather than comparing |contents| because by this time 995 // We use index here rather than comparing |contents| because by this time
974 // the model has already removed |contents| from its list, so 996 // the model has already removed |contents| from its list, so
975 // browser_->GetSelectedTabContents() will return NULL or something else. 997 // browser_->GetSelectedTabContents() will return NULL or something else.
976 if (index == browser_->tabstrip_model()->selected_index()) { 998 if (index == browser_->tabstrip_model()->selected_index()) {
977 // We need to reset the current tab contents to NULL before it gets 999 // We need to reset the current tab contents to NULL before it gets
978 // freed. This is because the focus manager performs some operations 1000 // freed. This is because the focus manager performs some operations
979 // on the selected TabContents when it is removed. 1001 // on the selected TabContents when it is removed.
980 infobar_container_->ChangeTabContents(NULL); 1002 infobar_container_->ChangeTabContents(NULL);
981 contents_container_->ChangeTabContents(NULL); 1003 contents_container_->ChangeTabContents(NULL);
1004 UpdateDevToolsForContents(NULL);
982 } 1005 }
983 } 1006 }
984 1007
985 void BrowserView::TabDeselectedAt(TabContents* contents, int index) { 1008 void BrowserView::TabDeselectedAt(TabContents* contents, int index) {
986 // We do not store the focus when closing the tab to work-around bug 4633. 1009 // We do not store the focus when closing the tab to work-around bug 4633.
987 // Some reports seem to show that the focus manager and/or focused view can 1010 // Some reports seem to show that the focus manager and/or focused view can
988 // be garbage at that point, it is not clear why. 1011 // be garbage at that point, it is not clear why.
989 if (!contents->is_being_destroyed()) 1012 if (!contents->is_being_destroyed())
990 contents->view()->StoreFocus(); 1013 contents->view()->StoreFocus();
991 } 1014 }
992 1015
993 void BrowserView::TabSelectedAt(TabContents* old_contents, 1016 void BrowserView::TabSelectedAt(TabContents* old_contents,
994 TabContents* new_contents, 1017 TabContents* new_contents,
995 int index, 1018 int index,
996 bool user_gesture) { 1019 bool user_gesture) {
997 DCHECK(old_contents != new_contents); 1020 DCHECK(old_contents != new_contents);
998 1021
999 // Update various elements that are interested in knowing the current 1022 // Update various elements that are interested in knowing the current
1000 // TabContents. 1023 // TabContents.
1001 infobar_container_->ChangeTabContents(new_contents); 1024 infobar_container_->ChangeTabContents(new_contents);
1002 contents_container_->ChangeTabContents(new_contents); 1025 contents_container_->ChangeTabContents(new_contents);
1026 UpdateDevToolsForContents(new_contents);
1003 // TODO(beng): This should be called automatically by ChangeTabContents, but I 1027 // TODO(beng): This should be called automatically by ChangeTabContents, but I
1004 // am striving for parity now rather than cleanliness. This is 1028 // am striving for parity now rather than cleanliness. This is
1005 // required to make features like Duplicate Tab, Undo Close Tab, 1029 // required to make features like Duplicate Tab, Undo Close Tab,
1006 // etc not result in sad tab. 1030 // etc not result in sad tab.
1007 new_contents->DidBecomeSelected(); 1031 new_contents->DidBecomeSelected();
1008 if (BrowserList::GetLastActive() == browser_ && 1032 if (BrowserList::GetLastActive() == browser_ &&
1009 !browser_->tabstrip_model()->closing_all() && GetWindow()->IsVisible()) { 1033 !browser_->tabstrip_model()->closing_all() && GetWindow()->IsVisible()) {
1010 // We only restore focus if our window is visible, to avoid invoking blur 1034 // We only restore focus if our window is visible, to avoid invoking blur
1011 // handlers when we are eventually shown. 1035 // handlers when we are eventually shown.
1012 new_contents->view()->RestoreFocus(); 1036 new_contents->view()->RestoreFocus();
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after
1315 toolbar_->GetMinimumSize() : gfx::Size()); 1339 toolbar_->GetMinimumSize() : gfx::Size());
1316 if (tabstrip_size.height() && toolbar_size.height()) 1340 if (tabstrip_size.height() && toolbar_size.height())
1317 toolbar_size.Enlarge(0, -kToolbarTabStripVerticalOverlap); 1341 toolbar_size.Enlarge(0, -kToolbarTabStripVerticalOverlap);
1318 gfx::Size bookmark_bar_size; 1342 gfx::Size bookmark_bar_size;
1319 if (active_bookmark_bar_ && 1343 if (active_bookmark_bar_ &&
1320 browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR)) { 1344 browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR)) {
1321 bookmark_bar_size = active_bookmark_bar_->GetMinimumSize(); 1345 bookmark_bar_size = active_bookmark_bar_->GetMinimumSize();
1322 bookmark_bar_size.Enlarge(0, 1346 bookmark_bar_size.Enlarge(0,
1323 -kSeparationLineHeight - bookmark_bar_view_->GetToolbarOverlap(true)); 1347 -kSeparationLineHeight - bookmark_bar_view_->GetToolbarOverlap(true));
1324 } 1348 }
1325 gfx::Size contents_size(contents_container_->GetMinimumSize()); 1349 gfx::Size contents_size(contents_split_->GetMinimumSize());
1326 1350
1327 int min_height = tabstrip_size.height() + toolbar_size.height() + 1351 int min_height = tabstrip_size.height() + toolbar_size.height() +
1328 bookmark_bar_size.height() + contents_size.height(); 1352 bookmark_bar_size.height() + contents_size.height();
1329 int widths[] = { tabstrip_size.width(), toolbar_size.width(), 1353 int widths[] = { tabstrip_size.width(), toolbar_size.width(),
1330 bookmark_bar_size.width(), contents_size.width() }; 1354 bookmark_bar_size.width(), contents_size.width() };
1331 int min_width = *std::max_element(&widths[0], &widths[arraysize(widths)]); 1355 int min_width = *std::max_element(&widths[0], &widths[arraysize(widths)]);
1332 return gfx::Size(min_width, min_height); 1356 return gfx::Size(min_width, min_height);
1333 } 1357 }
1334 1358
1335 /////////////////////////////////////////////////////////////////////////////// 1359 ///////////////////////////////////////////////////////////////////////////////
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after
1405 AddChildView(toolbar_); 1429 AddChildView(toolbar_);
1406 toolbar_->SetID(VIEW_ID_TOOLBAR); 1430 toolbar_->SetID(VIEW_ID_TOOLBAR);
1407 toolbar_->Init(browser_->profile()); 1431 toolbar_->Init(browser_->profile());
1408 toolbar_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_TOOLBAR)); 1432 toolbar_->SetAccessibleName(l10n_util::GetString(IDS_ACCNAME_TOOLBAR));
1409 1433
1410 infobar_container_ = new InfoBarContainer(this); 1434 infobar_container_ = new InfoBarContainer(this);
1411 AddChildView(infobar_container_); 1435 AddChildView(infobar_container_);
1412 1436
1413 contents_container_ = new TabContentsContainer; 1437 contents_container_ = new TabContentsContainer;
1414 set_contents_view(contents_container_); 1438 set_contents_view(contents_container_);
1415 AddChildView(contents_container_); 1439
1440 devtools_container_ = new TabContentsContainer;
1441 contents_split_ = new views::SingleSplitView(
1442 contents_container_,
1443 devtools_container_,
1444 views::SingleSplitView::VERTICAL_SPLIT);
1445
1446 AddChildView(contents_split_);
1416 1447
1417 status_bubble_.reset(new StatusBubbleViews(GetWidget())); 1448 status_bubble_.reset(new StatusBubbleViews(GetWidget()));
1418 1449
1419 extension_shelf_ = new ExtensionShelf(browser_.get()); 1450 extension_shelf_ = new ExtensionShelf(browser_.get());
1420 AddChildView(extension_shelf_); 1451 AddChildView(extension_shelf_);
1421 1452
1422 #if defined(OS_WIN) 1453 #if defined(OS_WIN)
1423 InitSystemMenu(); 1454 InitSystemMenu();
1424 #endif 1455 #endif
1425 } 1456 }
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after
1500 1531
1501 int BrowserView::LayoutInfoBar(int top) { 1532 int BrowserView::LayoutInfoBar(int top) {
1502 bool visible = browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR); 1533 bool visible = browser_->SupportsWindowFeature(Browser::FEATURE_INFOBAR);
1503 int height = visible ? infobar_container_->GetPreferredSize().height() : 0; 1534 int height = visible ? infobar_container_->GetPreferredSize().height() : 0;
1504 infobar_container_->SetVisible(visible); 1535 infobar_container_->SetVisible(visible);
1505 infobar_container_->SetBounds(0, top, width(), height); 1536 infobar_container_->SetBounds(0, top, width(), height);
1506 return top + height; 1537 return top + height;
1507 } 1538 }
1508 1539
1509 void BrowserView::LayoutTabContents(int top, int bottom) { 1540 void BrowserView::LayoutTabContents(int top, int bottom) {
1510 contents_container_->SetBounds(0, top, width(), bottom - top); 1541 contents_split_->SetBounds(0, top, width(), bottom - top);
1511 } 1542 }
1512 1543
1513 int BrowserView::LayoutDownloadShelf(int bottom) { 1544 int BrowserView::LayoutDownloadShelf(int bottom) {
1514 if (IsDownloadShelfVisible()) { 1545 if (IsDownloadShelfVisible()) {
1515 bool visible = browser_->SupportsWindowFeature( 1546 bool visible = browser_->SupportsWindowFeature(
1516 Browser::FEATURE_DOWNLOADSHELF); 1547 Browser::FEATURE_DOWNLOADSHELF);
1517 DCHECK(download_shelf_.get()); 1548 DCHECK(download_shelf_.get());
1518 int height = visible ? download_shelf_->GetPreferredSize().height() : 0; 1549 int height = visible ? download_shelf_->GetPreferredSize().height() : 0;
1519 download_shelf_->SetVisible(visible); 1550 download_shelf_->SetVisible(visible);
1520 download_shelf_->SetBounds(0, bottom - height, width(), height); 1551 download_shelf_->SetBounds(0, bottom - height, width(), height);
(...skipping 46 matching lines...) Expand 10 before | Expand all | Expand 10 after
1567 return UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_); 1598 return UpdateChildViewAndLayout(new_bookmark_bar_view, &active_bookmark_bar_);
1568 } 1599 }
1569 1600
1570 bool BrowserView::MaybeShowInfoBar(TabContents* contents) { 1601 bool BrowserView::MaybeShowInfoBar(TabContents* contents) {
1571 // TODO(beng): Remove this function once the interface between 1602 // TODO(beng): Remove this function once the interface between
1572 // InfoBarContainer, DownloadShelfView and TabContents and this 1603 // InfoBarContainer, DownloadShelfView and TabContents and this
1573 // view is sorted out. 1604 // view is sorted out.
1574 return true; 1605 return true;
1575 } 1606 }
1576 1607
1608 void BrowserView::UpdateDevToolsForContents(TabContents* tab_contents) {
1609 TabContents* devtools_contents =
1610 DevToolsWindow::GetDevToolsContents(tab_contents);
1611 devtools_container_->ChangeTabContents(devtools_contents);
1612 devtools_container_->SetVisible(devtools_contents != NULL);
1613 }
1614
1577 void BrowserView::UpdateUIForContents(TabContents* contents) { 1615 void BrowserView::UpdateUIForContents(TabContents* contents) {
1578 bool needs_layout = MaybeShowBookmarkBar(contents); 1616 bool needs_layout = MaybeShowBookmarkBar(contents);
1579 needs_layout |= MaybeShowInfoBar(contents); 1617 needs_layout |= MaybeShowInfoBar(contents);
1580 if (needs_layout) 1618 if (needs_layout)
1581 Layout(); 1619 Layout();
1582 } 1620 }
1583 1621
1584 bool BrowserView::UpdateChildViewAndLayout(views::View* new_view, 1622 bool BrowserView::UpdateChildViewAndLayout(views::View* new_view,
1585 views::View** old_view) { 1623 views::View** old_view) {
1586 DCHECK(old_view); 1624 DCHECK(old_view);
(...skipping 225 matching lines...) Expand 10 before | Expand all | Expand 10 after
1812 1850
1813 // static 1851 // static
1814 FindBar* BrowserWindow::CreateFindBar(Browser* browser) { 1852 FindBar* BrowserWindow::CreateFindBar(Browser* browser) {
1815 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window())); 1853 return browser::CreateFindBar(static_cast<BrowserView*>(browser->window()));
1816 } 1854 }
1817 1855
1818 // static 1856 // static
1819 void BrowserList::AllBrowsersClosed() { 1857 void BrowserList::AllBrowsersClosed() {
1820 views::Window::CloseAllSecondaryWindows(); 1858 views::Window::CloseAllSecondaryWindows();
1821 } 1859 }
OLDNEW
« no previous file with comments | « chrome/browser/views/frame/browser_view.h ('k') | webkit/glue/devtools/js/devtools.css » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698