| 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 "chrome/browser/views/frame/browser_view.h" | 5 #include "chrome/browser/views/frame/browser_view.h" |
| 6 | 6 |
| 7 #include "base/command_line.h" | 7 #include "base/command_line.h" |
| 8 #include "base/file_version_info.h" | 8 #include "base/file_version_info.h" |
| 9 #include "base/time.h" | 9 #include "base/time.h" |
| 10 #include "chrome/app/chrome_dll_resource.h" | 10 #include "chrome/app/chrome_dll_resource.h" |
| (...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 68 // static | 68 // static |
| 69 SkBitmap BrowserView::default_favicon_; | 69 SkBitmap BrowserView::default_favicon_; |
| 70 SkBitmap BrowserView::otr_avatar_; | 70 SkBitmap BrowserView::otr_avatar_; |
| 71 // The vertical overlap between the TabStrip and the Toolbar. | 71 // The vertical overlap between the TabStrip and the Toolbar. |
| 72 static const int kToolbarTabStripVerticalOverlap = 3; | 72 static const int kToolbarTabStripVerticalOverlap = 3; |
| 73 // The visible height of the shadow above the tabs. Clicks in this area are | 73 // The visible height of the shadow above the tabs. Clicks in this area are |
| 74 // treated as clicks to the frame, rather than clicks to the tab. | 74 // treated as clicks to the frame, rather than clicks to the tab. |
| 75 static const int kTabShadowSize = 2; | 75 static const int kTabShadowSize = 2; |
| 76 // The height of the status bubble. | 76 // The height of the status bubble. |
| 77 static const int kStatusBubbleHeight = 20; | 77 static const int kStatusBubbleHeight = 20; |
| 78 // The overlap of the status bubble with the window frame. | |
| 79 static const int kStatusBubbleOverlap = 1; | |
| 80 // An offset distance between certain toolbars and the toolbar that preceded | 78 // An offset distance between certain toolbars and the toolbar that preceded |
| 81 // them in layout. | 79 // them in layout. |
| 82 static const int kSeparationLineHeight = 1; | 80 static const int kSeparationLineHeight = 1; |
| 83 // The name of a key to store on the window handle so that other code can | 81 // The name of a key to store on the window handle so that other code can |
| 84 // locate this object using just the handle. | 82 // locate this object using just the handle. |
| 85 static const wchar_t* kBrowserViewKey = L"__BROWSER_VIEW__"; | 83 static const wchar_t* kBrowserViewKey = L"__BROWSER_VIEW__"; |
| 86 // How frequently we check for hung plugin windows. | 84 // How frequently we check for hung plugin windows. |
| 87 static const int kDefaultHungPluginDetectFrequency = 2000; | 85 static const int kDefaultHungPluginDetectFrequency = 2000; |
| 88 // How long do we wait before we consider a window hung (in ms). | 86 // How long do we wait before we consider a window hung (in ms). |
| 89 static const int kDefaultPluginMessageResponseTimeout = 30000; | 87 static const int kDefaultPluginMessageResponseTimeout = 30000; |
| (...skipping 1286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1376 active_download_shelf_->SetBounds(0, bottom - height, width(), height); | 1374 active_download_shelf_->SetBounds(0, bottom - height, width(), height); |
| 1377 active_download_shelf_->Layout(); | 1375 active_download_shelf_->Layout(); |
| 1378 bottom -= height; | 1376 bottom -= height; |
| 1379 } | 1377 } |
| 1380 return bottom; | 1378 return bottom; |
| 1381 } | 1379 } |
| 1382 | 1380 |
| 1383 void BrowserView::LayoutStatusBubble(int top) { | 1381 void BrowserView::LayoutStatusBubble(int top) { |
| 1384 // In restored mode, the client area has a client edge between it and the | 1382 // In restored mode, the client area has a client edge between it and the |
| 1385 // frame. | 1383 // frame. |
| 1386 int overlap = kStatusBubbleOverlap + | 1384 int overlap = StatusBubbleViews::kShadowThickness + |
| 1387 (IsMaximized() ? 0 : views::NonClientFrameView::kClientEdgeThickness); | 1385 (IsMaximized() ? 0 : views::NonClientFrameView::kClientEdgeThickness); |
| 1388 gfx::Point origin(-overlap, top - kStatusBubbleHeight + overlap); | 1386 gfx::Point origin(-overlap, top - kStatusBubbleHeight + overlap); |
| 1389 ConvertPointToView(this, GetParent(), &origin); | 1387 ConvertPointToView(this, GetParent(), &origin); |
| 1390 status_bubble_->SetBounds(origin.x(), origin.y(), width() / 3, | 1388 status_bubble_->SetBounds(origin.x(), origin.y(), width() / 3, |
| 1391 kStatusBubbleHeight); | 1389 kStatusBubbleHeight); |
| 1392 } | 1390 } |
| 1393 | 1391 |
| 1394 bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) { | 1392 bool BrowserView::MaybeShowBookmarkBar(TabContents* contents) { |
| 1395 views::View* new_bookmark_bar_view = NULL; | 1393 views::View* new_bookmark_bar_view = NULL; |
| 1396 if (browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) | 1394 if (browser_->SupportsWindowFeature(Browser::FEATURE_BOOKMARKBAR) |
| (...skipping 233 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1630 initialized = true; | 1628 initialized = true; |
| 1631 } | 1629 } |
| 1632 } | 1630 } |
| 1633 | 1631 |
| 1634 // static | 1632 // static |
| 1635 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { | 1633 BrowserWindow* BrowserWindow::CreateBrowserWindow(Browser* browser) { |
| 1636 BrowserView* browser_view = new BrowserView(browser); | 1634 BrowserView* browser_view = new BrowserView(browser); |
| 1637 (new BrowserFrame(browser_view))->Init(); | 1635 (new BrowserFrame(browser_view))->Init(); |
| 1638 return browser_view; | 1636 return browser_view; |
| 1639 } | 1637 } |
| OLD | NEW |