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

Side by Side Diff: chrome/browser/ui/views/tabs/tab.cc

Issue 136093007: Widget::ShouldUseNativeFrame is now meaningful on Linux. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Big refactor; fix Windows opaque windows when Glass is enabled. Created 6 years, 10 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
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 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/ui/views/tabs/tab.h" 5 #include "chrome/browser/ui/views/tabs/tab.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "base/command_line.h" 9 #include "base/command_line.h"
10 #include "base/debug/alias.h" 10 #include "base/debug/alias.h"
(...skipping 1668 matching lines...) Expand 10 before | Expand all | Expand 10 after
1679 const int kBarPadding = 1; 1679 const int kBarPadding = 1;
1680 int main_bar_left = tab_active_.l_width - kBarPadding; 1680 int main_bar_left = tab_active_.l_width - kBarPadding;
1681 int main_bar_right = width() - tab_active_.r_width + kBarPadding; 1681 int main_bar_right = width() - tab_active_.r_width + kBarPadding;
1682 return gfx::Rect( 1682 return gfx::Rect(
1683 main_bar_left, 0, main_bar_right - main_bar_left, kImmersiveBarHeight); 1683 main_bar_left, 0, main_bar_right - main_bar_left, kImmersiveBarHeight);
1684 } 1684 }
1685 1685
1686 void Tab::GetTabIdAndFrameId(views::Widget* widget, 1686 void Tab::GetTabIdAndFrameId(views::Widget* widget,
1687 int* tab_id, 1687 int* tab_id,
1688 int* frame_id) const { 1688 int* frame_id) const {
1689 if (widget && widget->GetTopLevelWidget()->ShouldUseNativeFrame()) { 1689 if (widget &&
1690 widget->GetTopLevelWidget()->ShouldWindowContentsBeTransparent()) {
1690 *tab_id = IDR_THEME_TAB_BACKGROUND_V; 1691 *tab_id = IDR_THEME_TAB_BACKGROUND_V;
1691 *frame_id = 0; 1692 *frame_id = 0;
1692 } else if (data().incognito) { 1693 } else if (data().incognito) {
1693 *tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO; 1694 *tab_id = IDR_THEME_TAB_BACKGROUND_INCOGNITO;
1694 *frame_id = IDR_THEME_FRAME_INCOGNITO; 1695 *frame_id = IDR_THEME_FRAME_INCOGNITO;
1695 #if defined(OS_WIN) 1696 #if defined(OS_WIN)
1696 } else if (win8::IsSingleWindowMetroMode()) { 1697 } else if (win8::IsSingleWindowMetroMode()) {
1697 *tab_id = IDR_THEME_TAB_BACKGROUND_V; 1698 *tab_id = IDR_THEME_TAB_BACKGROUND_V;
1698 *frame_id = 0; 1699 *frame_id = 0;
1699 #endif 1700 #endif
(...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after
1765 const gfx::ImageSkia& image) { 1766 const gfx::ImageSkia& image) {
1766 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE); 1767 DCHECK_NE(scale_factor, ui::SCALE_FACTOR_NONE);
1767 ImageCacheEntry entry; 1768 ImageCacheEntry entry;
1768 entry.resource_id = resource_id; 1769 entry.resource_id = resource_id;
1769 entry.scale_factor = scale_factor; 1770 entry.scale_factor = scale_factor;
1770 entry.image = image; 1771 entry.image = image;
1771 image_cache_->push_front(entry); 1772 image_cache_->push_front(entry);
1772 if (image_cache_->size() > kMaxImageCacheSize) 1773 if (image_cache_->size() > kMaxImageCacheSize)
1773 image_cache_->pop_back(); 1774 image_cache_->pop_back();
1774 } 1775 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698