| OLD | NEW |
| 1 // Copyright (c) 2006-2008 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2006-2008 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 "base/command_line.h" | 5 #include "base/command_line.h" |
| 6 | 6 |
| 7 #include "chrome/browser/views/frame/browser_view.h" | 7 #include "chrome/browser/views/frame/browser_view.h" |
| 8 | 8 |
| 9 #include "base/file_version_info.h" | 9 #include "base/file_version_info.h" |
| 10 #include "base/time.h" | 10 #include "base/time.h" |
| (...skipping 751 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 762 SupportsWindowFeature(FEATURE_LOCATIONBAR)) { | 762 SupportsWindowFeature(FEATURE_LOCATIONBAR)) { |
| 763 // If we're showing the toolbar, we need to adjust |*bounds| to include | 763 // If we're showing the toolbar, we need to adjust |*bounds| to include |
| 764 // its desired height, since the toolbar is considered part of the | 764 // its desired height, since the toolbar is considered part of the |
| 765 // window's client area as far as GetWindowBoundsForClientBounds is | 765 // window's client area as far as GetWindowBoundsForClientBounds is |
| 766 // concerned... | 766 // concerned... |
| 767 bounds->set_height( | 767 bounds->set_height( |
| 768 bounds->height() + toolbar_->GetPreferredSize().height()); | 768 bounds->height() + toolbar_->GetPreferredSize().height()); |
| 769 } | 769 } |
| 770 | 770 |
| 771 gfx::Rect window_rect = frame_->GetWindowBoundsForClientBounds(*bounds); | 771 gfx::Rect window_rect = frame_->GetWindowBoundsForClientBounds(*bounds); |
| 772 window_rect.set_origin(gfx::Point(bounds->x(), bounds->y())); | 772 window_rect.set_origin(bounds->origin()); |
| 773 | 773 |
| 774 // When we are given x/y coordinates of 0 on a created popup window, | 774 // When we are given x/y coordinates of 0 on a created popup window, |
| 775 // assume none were given by the window.open() command. | 775 // assume none were given by the window.open() command. |
| 776 if (window_rect.x() == 0 && window_rect.y() == 0) { | 776 if (window_rect.x() == 0 && window_rect.y() == 0) { |
| 777 gfx::Point origin = GetNormalBounds().origin(); | 777 window_rect.set_origin(GetNormalBounds().origin()); |
| 778 origin.set_x(origin.x() + kWindowTilePixels); | 778 window_rect.Offset(kWindowTilePixels, kWindowTilePixels); |
| 779 origin.set_y(origin.y() + kWindowTilePixels); | |
| 780 window_rect.set_origin(origin); | |
| 781 } | 779 } |
| 782 | 780 |
| 783 *bounds = window_rect; | 781 *bounds = window_rect; |
| 784 } | 782 } |
| 785 | 783 |
| 786 // We return true because we can _always_ locate reasonable bounds using the | 784 // We return true because we can _always_ locate reasonable bounds using the |
| 787 // WindowSizer, and we don't want to trigger the Window's built-in "size to | 785 // WindowSizer, and we don't want to trigger the Window's built-in "size to |
| 788 // default" handling because the browser window has no default preferred | 786 // default" handling because the browser window has no default preferred |
| 789 // size. | 787 // size. |
| 790 return true; | 788 return true; |
| (...skipping 238 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1029 gfx::Point tab_strip_loc(event.location()); | 1027 gfx::Point tab_strip_loc(event.location()); |
| 1030 ConvertPointToView(this, tabstrip_, &tab_strip_loc); | 1028 ConvertPointToView(this, tabstrip_, &tab_strip_loc); |
| 1031 return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(), | 1029 return new views::DropTargetEvent(event.GetData(), tab_strip_loc.x(), |
| 1032 tab_strip_loc.y(), | 1030 tab_strip_loc.y(), |
| 1033 event.GetSourceOperations()); | 1031 event.GetSourceOperations()); |
| 1034 } | 1032 } |
| 1035 | 1033 |
| 1036 int BrowserView::LayoutTabStrip() { | 1034 int BrowserView::LayoutTabStrip() { |
| 1037 if (IsTabStripVisible()) { | 1035 if (IsTabStripVisible()) { |
| 1038 gfx::Rect tabstrip_bounds = frame_->GetBoundsForTabStrip(tabstrip_); | 1036 gfx::Rect tabstrip_bounds = frame_->GetBoundsForTabStrip(tabstrip_); |
| 1037 gfx::Point tabstrip_origin = tabstrip_bounds.origin(); |
| 1038 ConvertPointToView(GetParent(), this, &tabstrip_origin); |
| 1039 tabstrip_bounds.set_origin(tabstrip_origin); |
| 1039 tabstrip_->SetBounds(tabstrip_bounds.x(), tabstrip_bounds.y(), | 1040 tabstrip_->SetBounds(tabstrip_bounds.x(), tabstrip_bounds.y(), |
| 1040 tabstrip_bounds.width(), tabstrip_bounds.height()); | 1041 tabstrip_bounds.width(), tabstrip_bounds.height()); |
| 1041 return tabstrip_bounds.bottom(); | 1042 return tabstrip_bounds.bottom(); |
| 1042 } | 1043 } |
| 1043 return 0; | 1044 return 0; |
| 1044 } | 1045 } |
| 1045 | 1046 |
| 1046 int BrowserView::LayoutToolbar(int top) { | 1047 int BrowserView::LayoutToolbar(int top) { |
| 1047 if (IsToolbarVisible()) { | 1048 if (IsToolbarVisible()) { |
| 1048 gfx::Size ps = toolbar_->GetPreferredSize(); | 1049 gfx::Size ps = toolbar_->GetPreferredSize(); |
| (...skipping 303 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1352 | 1353 |
| 1353 // static | 1354 // static |
| 1354 void BrowserView::InitClass() { | 1355 void BrowserView::InitClass() { |
| 1355 static bool initialized = false; | 1356 static bool initialized = false; |
| 1356 if (!initialized) { | 1357 if (!initialized) { |
| 1357 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1358 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 1358 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); | 1359 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); |
| 1359 initialized = true; | 1360 initialized = true; |
| 1360 } | 1361 } |
| 1361 } | 1362 } |
| OLD | NEW |