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

Side by Side Diff: chrome/browser/ui/panels/panel_browser_frame_view.cc

Issue 9015022: Replace most of Browser::GetSelectedTabContents calls into Browser::GetSelectedWebContents. I've ... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 8 years, 11 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/panels/panel.cc ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | 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) 2011 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2011 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/panels/panel_browser_frame_view.h" 5 #include "chrome/browser/ui/panels/panel_browser_frame_view.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "base/utf_string_conversions.h" 9 #include "base/utf_string_conversions.h"
10 #include "chrome/browser/themes/theme_service.h" 10 #include "chrome/browser/themes/theme_service.h"
(...skipping 20 matching lines...) Expand all
31 #include "ui/gfx/skia_util.h" 31 #include "ui/gfx/skia_util.h"
32 #include "ui/views/controls/button/image_button.h" 32 #include "ui/views/controls/button/image_button.h"
33 #include "ui/views/controls/button/menu_button.h" 33 #include "ui/views/controls/button/menu_button.h"
34 #include "ui/views/controls/label.h" 34 #include "ui/views/controls/label.h"
35 #include "ui/views/controls/menu/menu_item_view.h" 35 #include "ui/views/controls/menu/menu_item_view.h"
36 #include "ui/views/controls/menu/menu_model_adapter.h" 36 #include "ui/views/controls/menu/menu_model_adapter.h"
37 #include "ui/views/controls/menu/menu_runner.h" 37 #include "ui/views/controls/menu/menu_runner.h"
38 #include "ui/views/painter.h" 38 #include "ui/views/painter.h"
39 #include "ui/views/widget/widget_delegate.h" 39 #include "ui/views/widget/widget_delegate.h"
40 40
41 using content::WebContents;
42
41 namespace { 43 namespace {
42 44
43 // The height in pixels of the titlebar. 45 // The height in pixels of the titlebar.
44 const int kTitlebarHeight = 24; 46 const int kTitlebarHeight = 24;
45 47
46 // The thickness in pixels of the border. 48 // The thickness in pixels of the border.
47 const int kBorderThickness = 1; 49 const int kBorderThickness = 1;
48 50
49 // No client edge is present. 51 // No client edge is present.
50 const int kPanelClientEdgeThickness = 0; 52 const int kPanelClientEdgeThickness = 0;
(...skipping 567 matching lines...) Expand 10 before | Expand all | Expand 10 after
618 settings_button_, gfx::Rect(screen_point, source->size()), 620 settings_button_, gfx::Rect(screen_point, source->size()),
619 views::MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) == 621 views::MenuItemView::TOPRIGHT, views::MenuRunner::HAS_MNEMONICS) ==
620 views::MenuRunner::MENU_DELETED) 622 views::MenuRunner::MENU_DELETED)
621 return; 623 return;
622 } 624 }
623 625
624 bool PanelBrowserFrameView::ShouldTabIconViewAnimate() const { 626 bool PanelBrowserFrameView::ShouldTabIconViewAnimate() const {
625 // This function is queried during the creation of the window as the 627 // This function is queried during the creation of the window as the
626 // TabIconView we host is initialized, so we need to NULL check the selected 628 // TabIconView we host is initialized, so we need to NULL check the selected
627 // TabContents because in this condition there is not yet a selected tab. 629 // TabContents because in this condition there is not yet a selected tab.
628 TabContents* current_tab = browser_view()->GetSelectedTabContents(); 630 WebContents* current_tab = browser_view()->GetSelectedWebContents();
629 return current_tab ? current_tab->IsLoading() : false; 631 return current_tab ? current_tab->IsLoading() : false;
630 } 632 }
631 633
632 SkBitmap PanelBrowserFrameView::GetFaviconForTabIconView() { 634 SkBitmap PanelBrowserFrameView::GetFaviconForTabIconView() {
633 return frame()->widget_delegate()->GetWindowIcon(); 635 return frame()->widget_delegate()->GetWindowIcon();
634 } 636 }
635 637
636 void PanelBrowserFrameView::AnimationEnded(const ui::Animation* animation) { 638 void PanelBrowserFrameView::AnimationEnded(const ui::Animation* animation) {
637 settings_button_->SetVisible(is_settings_button_visible_); 639 settings_button_->SetVisible(is_settings_button_visible_);
638 } 640 }
(...skipping 240 matching lines...) Expand 10 before | Expand all | Expand 10 after
879 881
880 settings_menu_model_.reset( 882 settings_menu_model_.reset(
881 new PanelSettingsMenuModel(panel_browser_view_->panel())); 883 new PanelSettingsMenuModel(panel_browser_view_->panel()));
882 settings_menu_adapter_.reset( 884 settings_menu_adapter_.reset(
883 new views::MenuModelAdapter(settings_menu_model_.get())); 885 new views::MenuModelAdapter(settings_menu_model_.get()));
884 settings_menu_ = new views::MenuItemView(settings_menu_adapter_.get()); 886 settings_menu_ = new views::MenuItemView(settings_menu_adapter_.get());
885 settings_menu_adapter_->BuildMenu(settings_menu_); 887 settings_menu_adapter_->BuildMenu(settings_menu_);
886 settings_menu_runner_.reset(new views::MenuRunner(settings_menu_)); 888 settings_menu_runner_.reset(new views::MenuRunner(settings_menu_));
887 return true; 889 return true;
888 } 890 }
OLDNEW
« no previous file with comments | « chrome/browser/ui/panels/panel.cc ('k') | chrome/browser/ui/panels/panel_browsertest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698