| 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 966 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 977 | 977 |
| 978 views::View* BrowserView::GetInitiallyFocusedView() { | 978 views::View* BrowserView::GetInitiallyFocusedView() { |
| 979 return toolbar_->GetLocationBarView(); | 979 return toolbar_->GetLocationBarView(); |
| 980 } | 980 } |
| 981 | 981 |
| 982 bool BrowserView::ShouldShowWindowTitle() const { | 982 bool BrowserView::ShouldShowWindowTitle() const { |
| 983 return SupportsWindowFeature(FEATURE_TITLEBAR); | 983 return SupportsWindowFeature(FEATURE_TITLEBAR); |
| 984 } | 984 } |
| 985 | 985 |
| 986 SkBitmap BrowserView::GetWindowIcon() { | 986 SkBitmap BrowserView::GetWindowIcon() { |
| 987 if (browser_->type() == Browser::TYPE_APP) | 987 if (browser_->type() & Browser::TYPE_APP) |
| 988 return browser_->GetCurrentPageIcon(); | 988 return browser_->GetCurrentPageIcon(); |
| 989 return SkBitmap(); | 989 return SkBitmap(); |
| 990 } | 990 } |
| 991 | 991 |
| 992 bool BrowserView::ShouldShowWindowIcon() const { | 992 bool BrowserView::ShouldShowWindowIcon() const { |
| 993 return SupportsWindowFeature(FEATURE_TITLEBAR); | 993 return SupportsWindowFeature(FEATURE_TITLEBAR); |
| 994 } | 994 } |
| 995 | 995 |
| 996 bool BrowserView::ExecuteWindowsCommand(int command_id) { | 996 bool BrowserView::ExecuteWindowsCommand(int command_id) { |
| 997 // Translate WM_APPCOMMAND command ids into a command id that the browser | 997 // Translate WM_APPCOMMAND command ids into a command id that the browser |
| (...skipping 21 matching lines...) Expand all Loading... |
| 1019 // catching the going-into-fullscreen sizing and positioning calls, which we | 1019 // catching the going-into-fullscreen sizing and positioning calls, which we |
| 1020 // want to ignore. | 1020 // want to ignore. |
| 1021 if (!fullscreen_ && browser_->ShouldSaveWindowPlacement()) { | 1021 if (!fullscreen_ && browser_->ShouldSaveWindowPlacement()) { |
| 1022 WindowDelegate::SaveWindowPlacement(bounds, maximized, always_on_top); | 1022 WindowDelegate::SaveWindowPlacement(bounds, maximized, always_on_top); |
| 1023 browser_->SaveWindowPlacement(bounds, maximized); | 1023 browser_->SaveWindowPlacement(bounds, maximized); |
| 1024 } | 1024 } |
| 1025 } | 1025 } |
| 1026 | 1026 |
| 1027 bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { | 1027 bool BrowserView::GetSavedWindowBounds(gfx::Rect* bounds) const { |
| 1028 *bounds = browser_->GetSavedWindowBounds(); | 1028 *bounds = browser_->GetSavedWindowBounds(); |
| 1029 if (browser_->type() == Browser::TYPE_POPUP) { | 1029 if (browser_->type() & Browser::TYPE_POPUP) { |
| 1030 // We are a popup window. The value passed in |bounds| represents two | 1030 // We are a popup window. The value passed in |bounds| represents two |
| 1031 // pieces of information: | 1031 // pieces of information: |
| 1032 // - the position of the window, in screen coordinates (outer position). | 1032 // - the position of the window, in screen coordinates (outer position). |
| 1033 // - the size of the content area (inner size). | 1033 // - the size of the content area (inner size). |
| 1034 // We need to use these values to determine the appropriate size and | 1034 // We need to use these values to determine the appropriate size and |
| 1035 // position of the resulting window. | 1035 // position of the resulting window. |
| 1036 if (IsToolbarVisible()) { | 1036 if (IsToolbarVisible()) { |
| 1037 // If we're showing the toolbar, we need to adjust |*bounds| to include | 1037 // If we're showing the toolbar, we need to adjust |*bounds| to include |
| 1038 // its desired height, since the toolbar is considered part of the | 1038 // its desired height, since the toolbar is considered part of the |
| 1039 // window's client area as far as GetWindowBoundsForClientBounds is | 1039 // window's client area as far as GetWindowBoundsForClientBounds is |
| (...skipping 256 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1296 | 1296 |
| 1297 bool BrowserView::SupportsWindowFeature(WindowFeature feature) const { | 1297 bool BrowserView::SupportsWindowFeature(WindowFeature feature) const { |
| 1298 unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF; | 1298 unsigned int features = FEATURE_INFOBAR | FEATURE_DOWNLOADSHELF; |
| 1299 if (IsBrowserTypeNormal()) | 1299 if (IsBrowserTypeNormal()) |
| 1300 features |= FEATURE_BOOKMARKBAR; | 1300 features |= FEATURE_BOOKMARKBAR; |
| 1301 if (!fullscreen_) { | 1301 if (!fullscreen_) { |
| 1302 if (IsBrowserTypeNormal()) | 1302 if (IsBrowserTypeNormal()) |
| 1303 features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR; | 1303 features |= FEATURE_TABSTRIP | FEATURE_TOOLBAR; |
| 1304 else | 1304 else |
| 1305 features |= FEATURE_TITLEBAR; | 1305 features |= FEATURE_TITLEBAR; |
| 1306 if (browser_->type() != Browser::TYPE_APP) | 1306 if ((browser_->type() & Browser::TYPE_APP) == 0) |
| 1307 features |= FEATURE_LOCATIONBAR; | 1307 features |= FEATURE_LOCATIONBAR; |
| 1308 } | 1308 } |
| 1309 return !!(features & feature); | 1309 return !!(features & feature); |
| 1310 } | 1310 } |
| 1311 | 1311 |
| 1312 bool BrowserView::ShouldForwardToTabStrip( | 1312 bool BrowserView::ShouldForwardToTabStrip( |
| 1313 const views::DropTargetEvent& event) { | 1313 const views::DropTargetEvent& event) { |
| 1314 if (!tabstrip_->IsVisible()) | 1314 if (!tabstrip_->IsVisible()) |
| 1315 return false; | 1315 return false; |
| 1316 | 1316 |
| (...skipping 350 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1667 | 1667 |
| 1668 // static | 1668 // static |
| 1669 void BrowserView::InitClass() { | 1669 void BrowserView::InitClass() { |
| 1670 static bool initialized = false; | 1670 static bool initialized = false; |
| 1671 if (!initialized) { | 1671 if (!initialized) { |
| 1672 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); | 1672 ResourceBundle& rb = ResourceBundle::GetSharedInstance(); |
| 1673 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); | 1673 default_favicon_ = *rb.GetBitmapNamed(IDR_DEFAULT_FAVICON); |
| 1674 initialized = true; | 1674 initialized = true; |
| 1675 } | 1675 } |
| 1676 } | 1676 } |
| OLD | NEW |