Fix "unused variable" warnings.
These were exposed by changing DISALLOW_COPY_AND_ASSIGN to use "= delete", and
must be fixed before that change can land.
See https://codereview.chromium.org/1981053002/ for the full CL.
BUG=447156
TEST=none
Review-Url: https://codereview.chromium.org/1995933002
Cr-Commit-Position: refs/heads/master@{#394911}
diff --git a/chrome/browser/ui/app_list/search/app_search_provider.cc b/chrome/browser/ui/app_list/search/app_search_provider.cc
index 8d38193e..27c986c6 100644
--- a/chrome/browser/ui/app_list/search/app_search_provider.cc
+++ b/chrome/browser/ui/app_list/search/app_search_provider.cc
@@ -239,8 +239,7 @@
AppListControllerDelegate* list_controller,
std::unique_ptr<base::Clock> clock,
AppListItemList* top_level_item_list)
- : profile_(profile),
- list_controller_(list_controller),
+ : list_controller_(list_controller),
top_level_item_list_(top_level_item_list),
clock_(std::move(clock)),
update_results_factory_(this) {
diff --git a/chrome/browser/ui/app_list/search/app_search_provider.h b/chrome/browser/ui/app_list/search/app_search_provider.h
index 683afdc7..1ba82f3 100644
--- a/chrome/browser/ui/app_list/search/app_search_provider.h
+++ b/chrome/browser/ui/app_list/search/app_search_provider.h
@@ -54,7 +54,6 @@
void RefreshApps();
void UpdateResults();
- Profile* profile_;
AppListControllerDelegate* list_controller_;
base::string16 query_;
Apps apps_;
diff --git a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
index ed03b08..bfb30cb 100644
--- a/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
+++ b/chrome/browser/ui/cocoa/website_settings/permission_bubble_controller.mm
@@ -65,21 +65,6 @@
const CGFloat kBubbleMinWidth = 315.0f;
const NSSize kPermissionIconSize = {18, 18};
-class MenuDelegate : public ui::SimpleMenuModel::Delegate {
- public:
- explicit MenuDelegate(PermissionBubbleController* bubble)
- : bubble_controller_(bubble) {}
- bool IsCommandIdChecked(int command_id) const override { return false; }
- bool IsCommandIdEnabled(int command_id) const override { return true; }
- bool GetAcceleratorForCommandId(int command_id,
- ui::Accelerator* accelerator) override {
- return false;
- }
- private:
- PermissionBubbleController* bubble_controller_; // Weak, owns us.
- DISALLOW_COPY_AND_ASSIGN(MenuDelegate);
-};
-
} // namespace
// NSPopUpButton with a menu containing two items: allow and block.
diff --git a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
index e717a72c..6bd1ab46 100644
--- a/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
+++ b/chrome/browser/ui/views/apps/chrome_native_app_window_views_win.cc
@@ -86,7 +86,7 @@
ChromeNativeAppWindowViewsWin::CreateStandardDesktopAppFrame() {
glass_frame_view_ = NULL;
if (ui::win::IsAeroGlassEnabled()) {
- glass_frame_view_ = new GlassAppWindowFrameViewWin(this, widget());
+ glass_frame_view_ = new GlassAppWindowFrameViewWin(widget());
return glass_frame_view_;
}
return ChromeNativeAppWindowViewsAura::CreateStandardDesktopAppFrame();
diff --git a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
index b3e3cb5..ee35b18 100644
--- a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
+++ b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.cc
@@ -20,11 +20,8 @@
const char GlassAppWindowFrameViewWin::kViewClassName[] =
"ui/views/apps/GlassAppWindowFrameViewWin";
-GlassAppWindowFrameViewWin::GlassAppWindowFrameViewWin(
- extensions::NativeAppWindow* window,
- views::Widget* widget)
- : window_(window), widget_(widget) {
-}
+GlassAppWindowFrameViewWin::GlassAppWindowFrameViewWin(views::Widget* widget)
+ : widget_(widget) {}
GlassAppWindowFrameViewWin::~GlassAppWindowFrameViewWin() {
}
diff --git a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h
index 12949b9..6d5b529 100644
--- a/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h
+++ b/chrome/browser/ui/views/apps/glass_app_window_frame_view_win.h
@@ -9,17 +9,12 @@
#include "ui/gfx/geometry/insets.h"
#include "ui/views/window/non_client_view.h"
-namespace extensions {
-class NativeAppWindow;
-}
-
// A glass style app window frame view.
class GlassAppWindowFrameViewWin : public views::NonClientFrameView {
public:
static const char kViewClassName[];
- explicit GlassAppWindowFrameViewWin(extensions::NativeAppWindow* window,
- views::Widget* widget);
+ explicit GlassAppWindowFrameViewWin(views::Widget* widget);
~GlassAppWindowFrameViewWin() override;
// The insets to the client area due to the glass frame.
@@ -46,7 +41,6 @@
gfx::Size GetMinimumSize() const override;
gfx::Size GetMaximumSize() const override;
- extensions::NativeAppWindow* window_;
views::Widget* widget_;
DISALLOW_COPY_AND_ASSIGN(GlassAppWindowFrameViewWin);
diff --git a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
index 5bd84c7..a6a3678 100644
--- a/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
+++ b/chrome/browser/ui/views/bookmarks/bookmark_bar_view.cc
@@ -278,9 +278,8 @@
BookmarkButton(views::ButtonListener* listener,
const GURL& url,
- const base::string16& title,
- Profile* profile)
- : BookmarkButtonBase(listener, title), url_(url), profile_(profile) {}
+ const base::string16& title)
+ : BookmarkButtonBase(listener, title), url_(url) {}
bool GetTooltipText(const gfx::Point& p,
base::string16* tooltip) const override {
@@ -295,7 +294,6 @@
private:
const GURL& url_;
- Profile* profile_;
DISALLOW_COPY_AND_ASSIGN(BookmarkButton);
};
@@ -1745,8 +1743,8 @@
views::View* BookmarkBarView::CreateBookmarkButton(const BookmarkNode* node) {
if (node->is_url()) {
- BookmarkButton* button = new BookmarkButton(
- this, node->url(), node->GetTitle(), browser_->profile());
+ BookmarkButton* button =
+ new BookmarkButton(this, node->url(), node->GetTitle());
ConfigureButton(node, button);
return button;
}
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
index 0db8438c..c1d24a4 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.cc
@@ -338,11 +338,7 @@
details.push_back(prompt_->GetRetainedFile(i));
}
ExpandableContainerView* issue_advice_view =
- new ExpandableContainerView(this,
- base::string16(),
- details,
- scrollable_width,
- false);
+ new ExpandableContainerView(details, scrollable_width, false);
scroll_layout->AddView(issue_advice_view);
}
@@ -363,11 +359,7 @@
details.push_back(prompt_->GetRetainedDeviceMessageString(i));
}
ExpandableContainerView* issue_advice_view =
- new ExpandableContainerView(this,
- base::string16(),
- details,
- scrollable_width,
- false);
+ new ExpandableContainerView(details, scrollable_width, false);
scroll_layout->AddView(issue_advice_view);
}
@@ -427,11 +419,7 @@
details.push_back(PrepareForDisplay(
prompt_->GetPermissionsDetails(i, perm_type), false));
ExpandableContainerView* details_container =
- new ExpandableContainerView(this,
- base::string16(),
- details,
- left_column_width,
- true);
+ new ExpandableContainerView(details, left_column_width, true);
layout->AddView(details_container);
}
}
@@ -634,13 +622,10 @@
// ExpandableContainerView -----------------------------------------------------
ExpandableContainerView::ExpandableContainerView(
- ExtensionInstallDialogView* owner,
- const base::string16& description,
const PermissionDetails& details,
int horizontal_space,
bool parent_bulleted)
- : owner_(owner),
- details_view_(NULL),
+ : details_view_(NULL),
slide_animation_(this),
more_details_(NULL),
arrow_toggle_(NULL),
@@ -649,21 +634,8 @@
SetLayoutManager(layout);
int column_set_id = 0;
views::ColumnSet* column_set = layout->AddColumnSet(column_set_id);
- column_set->AddColumn(views::GridLayout::LEADING,
- views::GridLayout::LEADING,
- 0,
- views::GridLayout::USE_PREF,
- 0,
- 0);
- if (!description.empty()) {
- layout->StartRow(0, column_set_id);
-
- views::Label* description_label = new views::Label(description);
- description_label->SetMultiLine(true);
- description_label->SetHorizontalAlignment(gfx::ALIGN_LEFT);
- description_label->SizeToFit(horizontal_space);
- layout->AddView(new BulletedView(description_label));
- }
+ column_set->AddColumn(views::GridLayout::LEADING, views::GridLayout::LEADING,
+ 0, views::GridLayout::USE_PREF, 0, 0);
if (details.empty())
return;
diff --git a/chrome/browser/ui/views/extensions/extension_install_dialog_view.h b/chrome/browser/ui/views/extensions/extension_install_dialog_view.h
index 1f2fd22..ac6fbcd 100644
--- a/chrome/browser/ui/views/extensions/extension_install_dialog_view.h
+++ b/chrome/browser/ui/views/extensions/extension_install_dialog_view.h
@@ -126,9 +126,7 @@
public views::LinkListener,
public gfx::AnimationDelegate {
public:
- ExpandableContainerView(ExtensionInstallDialogView* owner,
- const base::string16& description,
- const PermissionDetails& details,
+ ExpandableContainerView(const PermissionDetails& details,
int horizontal_space,
bool parent_bulleted);
~ExpandableContainerView() override;
@@ -174,9 +172,6 @@
// Updates |arrow_toggle_| according to the given state.
void UpdateArrowToggle(bool expanded);
- // The dialog that owns |this|. It's also an ancestor in the View hierarchy.
- ExtensionInstallDialogView* owner_;
-
// A view for showing |issue_advice.details|.
DetailsView* details_view_;
diff --git a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
index a4a333a..f27f4e6 100644
--- a/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
+++ b/chrome/browser/ui/views/extensions/extension_installed_bubble_view.cc
@@ -97,8 +97,6 @@
gfx::Size GetIconSize() const;
ExtensionInstalledBubble* controller_;
- ExtensionInstalledBubble::BubbleType type_;
- ExtensionInstalledBubble::AnchorPosition anchor_position_;
// The shortcut to open the manage shortcuts page.
views::Link* manage_shortcut_;
diff --git a/chrome/browser/ui/views/frame/browser_frame.h b/chrome/browser/ui/views/frame/browser_frame.h
index 180490f..dc57338 100644
--- a/chrome/browser/ui/views/frame/browser_frame.h
+++ b/chrome/browser/ui/views/frame/browser_frame.h
@@ -19,7 +19,6 @@
class NativeBrowserFrame;
class NonClientFrameView;
class SystemMenuModelBuilder;
-class ThemeService;
namespace gfx {
class FontList;
@@ -139,8 +138,6 @@
// NativeBrowserFrame::UsesNativeSystemMenu() returns false.
std::unique_ptr<views::MenuRunner> menu_runner_;
- const ThemeService* theme_service_;
-
std::unique_ptr<ui::EventHandler> browser_command_handler_;
DISALLOW_COPY_AND_ASSIGN(BrowserFrame);
diff --git a/chrome/browser/ui/views/frame/browser_view.cc b/chrome/browser/ui/views/frame/browser_view.cc
index c318f8e..5be5b95 100644
--- a/chrome/browser/ui/views/frame/browser_view.cc
+++ b/chrome/browser/ui/views/frame/browser_view.cc
@@ -398,8 +398,7 @@
class BookmarkBarViewBackground : public views::Background {
public:
BookmarkBarViewBackground(BrowserView* browser_view,
- BookmarkBarView* bookmark_bar_view,
- Browser* browser);
+ BookmarkBarView* bookmark_bar_view);
// views:Background:
void Paint(gfx::Canvas* canvas, views::View* view) const override;
@@ -410,19 +409,13 @@
// The view hosting this background.
BookmarkBarView* bookmark_bar_view_;
- Browser* browser_;
-
DISALLOW_COPY_AND_ASSIGN(BookmarkBarViewBackground);
};
BookmarkBarViewBackground::BookmarkBarViewBackground(
BrowserView* browser_view,
- BookmarkBarView* bookmark_bar_view,
- Browser* browser)
- : browser_view_(browser_view),
- bookmark_bar_view_(bookmark_bar_view),
- browser_(browser) {
-}
+ BookmarkBarView* bookmark_bar_view)
+ : browser_view_(browser_view), bookmark_bar_view_(bookmark_bar_view) {}
void BookmarkBarViewBackground::Paint(gfx::Canvas* canvas,
views::View* view) const {
@@ -2156,8 +2149,8 @@
if (!bookmark_bar_view_.get()) {
bookmark_bar_view_.reset(new BookmarkBarView(browser_.get(), this));
bookmark_bar_view_->set_owned_by_client();
- bookmark_bar_view_->set_background(new BookmarkBarViewBackground(
- this, bookmark_bar_view_.get(), browser_.get()));
+ bookmark_bar_view_->set_background(
+ new BookmarkBarViewBackground(this, bookmark_bar_view_.get()));
bookmark_bar_view_->SetBookmarkBarState(
browser_->bookmark_bar_state(),
BookmarkBar::DONT_ANIMATE_STATE_CHANGE);
diff --git a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h
index 70a51d5..ff89116 100644
--- a/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h
+++ b/chrome/browser/ui/views/toolbar/toolbar_actions_bar_bubble_views.h
@@ -50,10 +50,7 @@
void LinkClicked(views::Link* source, int event_flags) override;
std::unique_ptr<ToolbarActionsBarBubbleDelegate> delegate_;
-
- views::Label* content_label_;
views::Label* item_list_;
-
views::Link* learn_more_button_;
DISALLOW_COPY_AND_ASSIGN(ToolbarActionsBarBubbleViews);
diff --git a/chrome/browser/ui/website_settings/website_settings.cc b/chrome/browser/ui/website_settings/website_settings.cc
index 3e3c3e43..1f36d34 100644
--- a/chrome/browser/ui/website_settings/website_settings.cc
+++ b/chrome/browser/ui/website_settings/website_settings.cc
@@ -216,7 +216,9 @@
: TabSpecificContentSettings::SiteDataObserver(
tab_specific_content_settings),
ui_(ui),
+#if !defined(OS_ANDROID)
web_contents_(web_contents),
+#endif
show_info_bar_(false),
site_url_(url),
site_identity_status_(SITE_IDENTITY_STATUS_UNKNOWN),
diff --git a/chrome/browser/ui/website_settings/website_settings.h b/chrome/browser/ui/website_settings/website_settings.h
index 7c05545..f684fa5 100644
--- a/chrome/browser/ui/website_settings/website_settings.h
+++ b/chrome/browser/ui/website_settings/website_settings.h
@@ -180,8 +180,10 @@
// information (identity, connection status, etc.).
WebsiteSettingsUI* ui_;
+#if !defined(OS_ANDROID)
// The WebContents of the active tab.
content::WebContents* web_contents_;
+#endif
// The flag that controls whether an infobar is displayed after the website
// settings UI is closed or not.
diff --git a/chrome/browser/ui/webui/mojo_web_ui_controller.cc b/chrome/browser/ui/webui/mojo_web_ui_controller.cc
index bccc291..9453b7a7 100644
--- a/chrome/browser/ui/webui/mojo_web_ui_controller.cc
+++ b/chrome/browser/ui/webui/mojo_web_ui_controller.cc
@@ -12,8 +12,7 @@
#include "mojo/public/cpp/system/core.h"
MojoWebUIControllerBase::MojoWebUIControllerBase(content::WebUI* contents)
- : WebUIController(contents), mojo_data_source_(NULL) {
-}
+ : WebUIController(contents) {}
MojoWebUIControllerBase::~MojoWebUIControllerBase() {
}
diff --git a/chrome/browser/ui/webui/mojo_web_ui_controller.h b/chrome/browser/ui/webui/mojo_web_ui_controller.h
index 45500dc6..68bd514e 100644
--- a/chrome/browser/ui/webui/mojo_web_ui_controller.h
+++ b/chrome/browser/ui/webui/mojo_web_ui_controller.h
@@ -19,10 +19,6 @@
class MojoWebUIHandler;
-namespace content {
-class WebUIDataSource;
-}
-
class MojoWebUIControllerBase : public content::WebUIController {
public:
explicit MojoWebUIControllerBase(content::WebUI* contents);
@@ -32,9 +28,6 @@
void RenderViewCreated(content::RenderViewHost* render_view_host) override;
private:
- // Bindings files are registered here.
- content::WebUIDataSource* mojo_data_source_;
-
DISALLOW_COPY_AND_ASSIGN(MojoWebUIControllerBase);
};
diff --git a/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc b/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
index e566aa8..afb9019 100644
--- a/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
+++ b/chrome/browser/ui/webui/popular_sites_internals_message_handler.cc
@@ -97,8 +97,7 @@
args->GetString(0, &url);
if (!url.empty()) {
popular_sites_.reset(new PopularSites(
- prefs, TemplateURLServiceFactory::GetForProfile(profile),
- profile->GetRequestContext(), ChromePopularSites::GetDirectory(),
+ prefs, profile->GetRequestContext(), ChromePopularSites::GetDirectory(),
url_formatter::FixupURL(url, std::string()), callback));
return;
}
diff --git a/chrome/browser/ui/webui/signin/login_ui_service.cc b/chrome/browser/ui/webui/signin/login_ui_service.cc
index 042f6c72..76faffe 100644
--- a/chrome/browser/ui/webui/signin/login_ui_service.cc
+++ b/chrome/browser/ui/webui/signin/login_ui_service.cc
@@ -17,7 +17,10 @@
#include "components/signin/core/common/profile_management_switches.h"
LoginUIService::LoginUIService(Profile* profile)
- : ui_(NULL), profile_(profile) {
+#if !defined(OS_CHROMEOS)
+ : profile_(profile)
+#endif
+{
}
LoginUIService::~LoginUIService() {}
diff --git a/chrome/browser/ui/webui/signin/login_ui_service.h b/chrome/browser/ui/webui/signin/login_ui_service.h
index bc789a3..27139f2 100644
--- a/chrome/browser/ui/webui/signin/login_ui_service.h
+++ b/chrome/browser/ui/webui/signin/login_ui_service.h
@@ -105,8 +105,10 @@
private:
// Weak pointer to the currently active login UI, or null if none.
- LoginUI* ui_;
+ LoginUI* ui_ = nullptr;
+#if !defined(OS_CHROMEOS)
Profile* profile_;
+#endif
// List of observers.
base::ObserverList<Observer> observer_list_;