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

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

Issue 10538099: Revert 141573 - Update use of OTR avatars for touch. We now select (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src/
Patch Set: Created 8 years, 6 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/ui/views/frame/browser_view.h ('k') | no next file » | 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) 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/frame/browser_view.h" 5 #include "chrome/browser/ui/views/frame/browser_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/auto_reset.h" 9 #include "base/auto_reset.h"
10 #include "base/command_line.h" 10 #include "base/command_line.h"
(...skipping 501 matching lines...) Expand 10 before | Expand all | Expand 10 after
512 return browser_->GetActiveWebContents(); 512 return browser_->GetActiveWebContents();
513 } 513 }
514 514
515 TabContents* BrowserView::GetActiveTabContents() const { 515 TabContents* BrowserView::GetActiveTabContents() const {
516 return browser_->GetActiveTabContents(); 516 return browser_->GetActiveTabContents();
517 } 517 }
518 518
519 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const { 519 gfx::ImageSkia BrowserView::GetOTRAvatarIcon() const {
520 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance(); 520 ui::ResourceBundle& rb = ui::ResourceBundle::GetSharedInstance();
521 const gfx::ImageSkia* otr_avatar = 521 const gfx::ImageSkia* otr_avatar =
522 rb.GetNativeImageNamed(GetOTRIconResourceID()).ToImageSkia(); 522 rb.GetNativeImageNamed(IDR_OTR_ICON).ToImageSkia();
523 return *otr_avatar; 523 return *otr_avatar;
524 } 524 }
525 525
526 bool BrowserView::IsPositionInWindowCaption(const gfx::Point& point) { 526 bool BrowserView::IsPositionInWindowCaption(const gfx::Point& point) {
527 return GetBrowserViewLayout()->IsPositionInWindowCaption(point); 527 return GetBrowserViewLayout()->IsPositionInWindowCaption(point);
528 } 528 }
529 529
530 /////////////////////////////////////////////////////////////////////////////// 530 ///////////////////////////////////////////////////////////////////////////////
531 // BrowserView, BrowserWindow implementation: 531 // BrowserView, BrowserWindow implementation:
532 532
(...skipping 1243 matching lines...) Expand 10 before | Expand all | Expand 10 after
1776 sender->child_at(i)->InvalidateLayout(); 1776 sender->child_at(i)->InvalidateLayout();
1777 SchedulePaint(); 1777 SchedulePaint();
1778 Layout(); 1778 Layout();
1779 return false; 1779 return false;
1780 } 1780 }
1781 1781
1782 void BrowserView::OnSysColorChange() { 1782 void BrowserView::OnSysColorChange() {
1783 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_); 1783 browser::MaybeShowInvertBubbleView(browser_->profile(), contents_);
1784 } 1784 }
1785 1785
1786 int BrowserView::GetOTRIconResourceID() const {
1787 int otr_resource_id = IDR_OTR_ICON;
1788 if (ui::GetDisplayLayout() == ui::LAYOUT_TOUCH) {
1789 if (IsFullscreen())
1790 otr_resource_id = IDR_OTR_ICON_FULLSCREEN;
1791 #if defined(OS_WIN)
1792 if (base::win::GetMetroModule() != NULL)
1793 otr_resource_id = IDR_OTR_ICON_FULLSCREEN;
1794 #endif
1795 }
1796
1797 return otr_resource_id;
1798 }
1799
1800 views::LayoutManager* BrowserView::CreateLayoutManager() const { 1786 views::LayoutManager* BrowserView::CreateLayoutManager() const {
1801 return new BrowserViewLayout; 1787 return new BrowserViewLayout;
1802 } 1788 }
1803 1789
1804 ToolbarView* BrowserView::CreateToolbar() const { 1790 ToolbarView* BrowserView::CreateToolbar() const {
1805 return new ToolbarView(browser_.get()); 1791 return new ToolbarView(browser_.get());
1806 } 1792 }
1807 1793
1808 void BrowserView::Init() { 1794 void BrowserView::Init() {
1809 GetWidget()->AddObserver(this); 1795 GetWidget()->AddObserver(this);
(...skipping 637 matching lines...) Expand 10 before | Expand all | Expand 10 after
2447 this, 2433 this,
2448 tab_contents->web_contents()->GetRenderViewHost(), 2434 tab_contents->web_contents()->GetRenderViewHost(),
2449 password_generator, 2435 password_generator,
2450 browser_.get(), 2436 browser_.get(),
2451 tab_contents->password_manager()); 2437 tab_contents->password_manager());
2452 2438
2453 views::BubbleDelegateView::CreateBubble(bubble); 2439 views::BubbleDelegateView::CreateBubble(bubble);
2454 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE); 2440 bubble->SetAlignment(views::BubbleBorder::ALIGN_EDGE_TO_ANCHOR_EDGE);
2455 bubble->Show(); 2441 bubble->Show();
2456 } 2442 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/frame/browser_view.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698