Commit 6e80cfe6 authored by thestig's avatar thestig Committed by Commit bot

Cleanup: Fix some lint errors in chrome/browser/ui.

Review URL: https://codereview.chromium.org/502593003

Cr-Commit-Position: refs/heads/master@{#291601}
parent 317db31b
......@@ -31,10 +31,10 @@ const int kTopInset = 10;
// Dialog for multi-profiles teleport warning.
class TeleportWarningView : public views::DialogDelegateView {
public:
TeleportWarningView(base::Callback<void(bool)> on_accept);
explicit TeleportWarningView(const base::Callback<void(bool)>& on_accept);
virtual ~TeleportWarningView();
static void ShowDialog(const base::Callback<void(bool)> on_accept);
static void ShowDialog(const base::Callback<void(bool)>& on_accept);
// views::DialogDelegate overrides.
virtual bool Accept() OVERRIDE;
......@@ -58,7 +58,7 @@ class TeleportWarningView : public views::DialogDelegateView {
// TeleportWarningView implementation.
TeleportWarningView::TeleportWarningView(
const base::Callback<void(bool)> on_accept)
const base::Callback<void(bool)>& on_accept)
: on_accept_(on_accept) {
}
......@@ -67,7 +67,7 @@ TeleportWarningView::~TeleportWarningView() {
// static
void TeleportWarningView::ShowDialog(
const base::Callback<void(bool)> on_accept) {
const base::Callback<void(bool)>& on_accept) {
TeleportWarningView* dialog_view =
new TeleportWarningView(on_accept);
views::DialogDelegate::CreateDialogWidget(
......@@ -156,7 +156,7 @@ void TeleportWarningView::InitDialog() {
// Factory function.
void ShowMultiprofilesWarningDialog(
const base::Callback<void(bool)> on_accept) {
const base::Callback<void(bool)>& on_accept) {
TeleportWarningView::ShowDialog(on_accept);
}
......
......@@ -5,12 +5,13 @@
#ifndef CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WARNING_DIALOG_H_
#define CHROME_BROWSER_UI_ASH_MULTI_USER_MULTI_USER_WARNING_DIALOG_H_
#include "base/callback.h"
#include "base/callback_forward.h"
namespace chromeos {
// Creates and shows dialog with introduction.
void ShowMultiprofilesWarningDialog(const base::Callback<void(bool)> on_accept);
void ShowMultiprofilesWarningDialog(
const base::Callback<void(bool)>& on_accept);
} // namespace chromeos
......
......@@ -53,9 +53,9 @@ scoped_ptr<base::DictionaryValue> CreateInputMethodsEntry(
}
// Returns true if element was inserted.
bool InsertString(const std::string& str, std::set<std::string>& to) {
bool InsertString(const std::string& str, std::set<std::string>* to) {
const std::pair<std::set<std::string>::iterator, bool> result =
to.insert(str);
to->insert(str);
return result.second;
}
......@@ -309,7 +309,7 @@ void GetKeyboardLayoutsForResolvedLocale(
it != layouts.end(); ++it) {
const input_method::InputMethodDescriptor* ime =
util->GetInputMethodDescriptorFromId(*it);
if (!InsertString(ime->id(), input_methods_added))
if (!InsertString(ime->id(), &input_methods_added))
continue;
input_methods_list->Append(
CreateInputMethodsEntry(*ime, selected).release());
......@@ -446,7 +446,7 @@ scoped_ptr<base::ListValue> GetAndActivateLoginKeyboardLayouts(
for (size_t i = 0; i < input_methods->size(); ++i) {
// Makes sure the id is in legacy xkb id format.
const std::string& ime_id = (*input_methods)[i].id();
if (!InsertString(ime_id, input_methods_added))
if (!InsertString(ime_id, &input_methods_added))
continue;
if (!optgroup_added) {
optgroup_added = true;
......
......@@ -50,7 +50,6 @@ const char kJsApiNetworkOnTimezoneChanged[] = "networkOnTimezoneChanged";
// "selected" only if loaded_locale is a backup for "requested_locale".
std::string CalculateSelectedLanguage(const std::string& requested_locale,
const std::string& loaded_locale) {
std::string resolved_locale;
if (!l10n_util::CheckAndResolveLocale(requested_locale, &resolved_locale))
return loaded_locale;
......@@ -243,10 +242,10 @@ void NetworkScreenHandler::HandleOnExit() {
struct NetworkScreenHandlerOnLanguageChangedCallbackData {
explicit NetworkScreenHandlerOnLanguageChangedCallbackData(
base::WeakPtr<NetworkScreenHandler>& handler)
: handler_(handler) {}
const base::WeakPtr<NetworkScreenHandler>& handler)
: handler(handler) {}
base::WeakPtr<NetworkScreenHandler> handler_;
base::WeakPtr<NetworkScreenHandler> handler;
// Block UI while resource bundle is being reloaded.
chromeos::InputEventsBlocker input_events_blocker;
......@@ -258,10 +257,10 @@ void NetworkScreenHandler::OnLanguageChangedCallback(
const std::string& requested_locale,
const std::string& loaded_locale,
const bool success) {
if (!context or !context->handler_)
if (!context || !context->handler)
return;
NetworkScreenHandler* const self = context->handler_.get();
NetworkScreenHandler* const self = context->handler.get();
if (success) {
if (requested_locale == loaded_locale) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment