clang-format chromium_src

This commit is contained in:
Shelley Vohr 2018-04-17 21:47:44 -04:00
parent c090dd2f81
commit 8cc81509d7
No known key found for this signature in database
GPG key ID: F13993A75599653C
38 changed files with 202 additions and 231 deletions

View file

@ -98,13 +98,11 @@ class CertificateManagerModel {
// Methods used during initialization, see the comment at the top of the .cc
// file for details.
static void DidGetCertDBOnUIThread(
net::NSSCertDatabase* cert_db,
bool is_user_db_available,
const CreationCallback& callback);
static void DidGetCertDBOnIOThread(
const CreationCallback& callback,
net::NSSCertDatabase* cert_db);
static void DidGetCertDBOnUIThread(net::NSSCertDatabase* cert_db,
bool is_user_db_available,
const CreationCallback& callback);
static void DidGetCertDBOnIOThread(const CreationCallback& callback,
net::NSSCertDatabase* cert_db);
static void GetCertDBOnIOThread(content::ResourceContext* context,
const CreationCallback& callback);

View file

@ -21,8 +21,9 @@ namespace extensions {
// forwards its output to the base class for processing.
//
// This class does two things:
// 1. Intercepts media/volume keys. Uses an event tap for intercepting media keys
// (PlayPause, NextTrack, PreviousTrack) and volume keys(VolumeUp, VolumeDown, VolumeMute).
// 1. Intercepts media/volume keys. Uses an event tap for intercepting media
// keys (PlayPause, NextTrack, PreviousTrack) and volume keys(VolumeUp,
// VolumeDown, VolumeMute).
// 2. Binds keyboard shortcuts (hot keys). Carbon RegisterEventHotKey API for
// binding to non-media key global hot keys (eg. Command-Shift-1).
class GlobalShortcutListenerMac : public GlobalShortcutListener {
@ -67,12 +68,15 @@ class GlobalShortcutListenerMac : public GlobalShortcutListener {
bool IsAnyHotKeyRegistered();
// The callback for when an event tap happens.
static CGEventRef EventTapCallback(
CGEventTapProxy proxy, CGEventType type, CGEventRef event, void* refcon);
static CGEventRef EventTapCallback(CGEventTapProxy proxy,
CGEventType type,
CGEventRef event,
void* refcon);
// The callback for when a hot key event happens.
static OSStatus HotKeyHandler(
EventHandlerCallRef next_handler, EventRef event, void* user_data);
static OSStatus HotKeyHandler(EventHandlerCallRef next_handler,
EventRef event,
void* user_data);
// Whether this object is listening for global shortcuts.
bool is_listening_;

View file

@ -5,8 +5,8 @@
#ifndef CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_
#define CHROME_BROWSER_EXTENSIONS_GLOBAL_SHORTCUT_LISTENER_X11_H_
#include <stdint.h>
#include <X11/Xlib.h>
#include <stdint.h>
#include <set>

View file

@ -97,7 +97,7 @@ class IconManager {
CacheKey(const IconLoader::IconGroup& group, IconLoader::IconSize size);
// Used as a key in the map below, so we need this comparator.
bool operator<(const CacheKey &other) const;
bool operator<(const CacheKey& other) const;
IconLoader::IconGroup group;
IconLoader::IconSize size;

View file

@ -209,9 +209,7 @@ class JobEventDetails : public base::RefCountedThreadSafe<JobEventDetails> {
// Getters.
PrintedDocument* document() const;
PrintedPage* page() const;
Type type() const {
return type_;
}
Type type() const { return type_; }
private:
friend class base::RefCountedThreadSafe<JobEventDetails>;

View file

@ -43,7 +43,7 @@ class PrintQueriesQueue : public base::RefCountedThreadSafe<PrintQueriesQueue> {
private:
friend class base::RefCountedThreadSafe<PrintQueriesQueue>;
typedef std::vector<scoped_refptr<PrinterQuery> > PrinterQueries;
typedef std::vector<scoped_refptr<PrinterQuery>> PrinterQueries;
virtual ~PrintQueriesQueue();
@ -73,7 +73,7 @@ class PrintJobManager : public content::NotificationObserver {
scoped_refptr<PrintQueriesQueue> queue();
private:
typedef std::set<scoped_refptr<PrintJob> > PrintJobs;
typedef std::set<scoped_refptr<PrintJob>> PrintJobs;
// Processes a NOTIFY_PRINT_JOB_EVENT notification.
void OnPrintJobEvent(PrintJob* print_job,

View file

@ -77,8 +77,7 @@ class PrintJobWorker {
bool IsRunning() const;
// Posts the given task to be run.
bool PostTask(const base::Location& from_here,
const base::Closure& task);
bool PostTask(const base::Location& from_here, const base::Closure& task);
// Signals the thread to exit in the near future.
void StopSoon();
@ -114,10 +113,9 @@ class PrintJobWorker {
// Asks the user for print settings. Must be called on the UI thread.
// Required on Mac and Linux. Windows can display UI from non-main threads,
// but sticks with this for consistency.
void GetSettingsWithUI(
int document_page_count,
bool has_selection,
bool is_scripted);
void GetSettingsWithUI(int document_page_count,
bool has_selection,
bool is_scripted);
// Called on the UI thread to update the print settings.
void UpdatePrintSettings(std::unique_ptr<base::DictionaryValue> new_settings);

View file

@ -14,7 +14,7 @@
namespace base {
class MessageLoop;
class SequencedTaskRunner;
}
} // namespace base
namespace printing {
@ -48,8 +48,7 @@ class PrintJobWorkerOwner
bool RunsTasksInCurrentSequence() const;
// Posts the given task to be run.
bool PostTask(const base::Location& from_here,
const base::Closure& task);
bool PostTask(const base::Location& from_here, const base::Closure& task);
protected:
friend class base::RefCountedThreadSafe<PrintJobWorkerOwner>;

View file

@ -9,8 +9,8 @@
#include "base/callback.h"
#include "base/memory/ref_counted.h"
#include "components/prefs/pref_member.h"
#include "base/strings/string16.h"
#include "components/prefs/pref_member.h"
#include "content/public/browser/notification_observer.h"
#include "content/public/browser/notification_registrar.h"
#include "content/public/browser/web_contents_observer.h"
@ -41,16 +41,15 @@ class PrintViewManagerBase : public content::NotificationObserver,
// asynchronous, the actual printing will not be completed on the return of
// this function. Returns false if printing is impossible at the moment.
virtual bool PrintNow(content::RenderFrameHost* rfh,
bool silent, bool print_background,
bool silent,
bool print_background,
const base::string16& device_name);
#endif // !DISABLE_BASIC_PRINTING
// PrintedPagesSource implementation.
base::string16 RenderSourceName();
void SetCallback(const base::Callback<void(bool)>& cb) {
callback = cb;
};
void SetCallback(const base::Callback<void(bool)>& cb) { callback = cb; };
protected:
explicit PrintViewManagerBase(content::WebContents* web_contents);

View file

@ -53,17 +53,16 @@ class PrinterQuery : public PrintJobWorkerOwner {
bool is_modifiable,
const base::Closure& callback);
void GetSettings(
GetSettingsAskParam ask_user_for_settings,
int expected_page_count,
bool has_selection,
MarginType margin_type,
bool is_scripted,
bool is_modifiable,
const base::string16& device_name,
const base::Closure& callback);
void GetSettings(GetSettingsAskParam ask_user_for_settings,
int expected_page_count,
bool has_selection,
MarginType margin_type,
bool is_scripted,
bool is_modifiable,
const base::string16& device_name,
const base::Closure& callback);
// Updates the current settings with |new_settings| dictionary values.
// Updates the current settings with |new_settings| dictionary values.
void SetSettings(std::unique_ptr<base::DictionaryValue> new_settings,
const base::Closure& callback);

View file

@ -15,7 +15,7 @@ struct PrintHostMsg_ScriptedPrint_Params;
namespace base {
class DictionaryValue;
class FilePath;
}
} // namespace base
namespace content {
class WebContents;
@ -33,9 +33,8 @@ class PrintingMessageFilter : public content::BrowserMessageFilter {
PrintingMessageFilter(int render_process_id);
// content::BrowserMessageFilter methods.
void OverrideThreadForMessage(
const IPC::Message& message,
content::BrowserThread::ID* thread) override;
void OverrideThreadForMessage(const IPC::Message& message,
content::BrowserThread::ID* thread) override;
bool OnMessageReceived(const IPC::Message& message) override;
private:

View file

@ -127,7 +127,7 @@ class ProcessSingleton {
NotificationCallback notification_callback_; // Handler for notifications.
#if defined(OS_WIN)
HWND remote_window_; // The HWND_MESSAGE of another browser.
HWND remote_window_; // The HWND_MESSAGE of another browser.
base::win::MessageWindow window_; // The message-only window.
bool is_virtualized_; // Stuck inside Microsoft Softricity VM environment.
HANDLE lock_file_;

View file

@ -18,7 +18,7 @@ namespace ppapi {
namespace host {
struct HostMessageContext;
}
}
} // namespace ppapi
namespace chrome {

View file

@ -17,7 +17,7 @@ class Time;
namespace content {
class BrowserPpapiHost;
class ResourceContext;
}
} // namespace content
class GURL;

View file

@ -15,7 +15,7 @@ namespace ppapi {
namespace host {
struct HostMessageContext;
}
}
} // namespace ppapi
namespace ui {
class ScopedClipboardWriter;

View file

@ -16,7 +16,7 @@ class BrowserContext;
class WidevineCdmMessageFilter : public content::BrowserMessageFilter {
public:
explicit WidevineCdmMessageFilter(int render_process_id,
content::BrowserContext* browser_context);
content::BrowserContext* browser_context);
bool OnMessageReceived(const IPC::Message& message) override;
void OnDestruct() const override;

View file

@ -40,11 +40,7 @@ enum TtsEventType {
TTS_EVENT_RESUME
};
enum TtsGenderType {
TTS_GENDER_NONE,
TTS_GENDER_MALE,
TTS_GENDER_FEMALE
};
enum TtsGenderType { TTS_GENDER_NONE, TTS_GENDER_MALE, TTS_GENDER_FEMALE };
// Returns true if this event type is one that indicates an utterance
// is finished and can be destroyed.
@ -167,14 +163,10 @@ class Utterance {
}
const std::string& voice_name() const { return voice_name_; }
void set_lang(const std::string& lang) {
lang_ = lang;
}
void set_lang(const std::string& lang) { lang_ = lang; }
const std::string& lang() const { return lang_; }
void set_gender(TtsGenderType gender) {
gender_ = gender;
}
void set_gender(TtsGenderType gender) { gender_ = gender; }
TtsGenderType gender() const { return gender_; }
void set_continuous_parameters(const UtteranceContinuousParameters& params) {

View file

@ -35,9 +35,9 @@ class TtsControllerImpl : public TtsController {
virtual void Pause() override;
virtual void Resume() override;
virtual void OnTtsEvent(int utterance_id,
TtsEventType event_type,
int char_index,
const std::string& error_message) override;
TtsEventType event_type,
int char_index,
const std::string& error_message) override;
virtual void GetVoices(content::BrowserContext* browser_context,
std::vector<VoiceData>* out_voices) override;
virtual void VoicesChanged() override;

View file

@ -14,18 +14,16 @@ namespace content {
class BrowserContext;
}
class TtsMessageFilter
: public content::BrowserMessageFilter,
public UtteranceEventDelegate,
public VoicesChangedDelegate {
class TtsMessageFilter : public content::BrowserMessageFilter,
public UtteranceEventDelegate,
public VoicesChangedDelegate {
public:
explicit TtsMessageFilter(int render_process_id,
content::BrowserContext* browser_context);
content::BrowserContext* browser_context);
// content::BrowserMessageFilter implementation.
void OverrideThreadForMessage(
const IPC::Message& message,
content::BrowserThread::ID* thread) override;
void OverrideThreadForMessage(const IPC::Message& message,
content::BrowserThread::ID* thread) override;
bool OnMessageReceived(const IPC::Message& message) override;
void OnChannelClosing() override;
void OnDestruct() const override;

View file

@ -33,12 +33,11 @@ class TtsPlatformImpl {
// The TtsController will only try to speak one utterance at
// a time. If it wants to interrupt speech, it will always call Stop
// before speaking again.
virtual bool Speak(
int utterance_id,
const std::string& utterance,
const std::string& lang,
const VoiceData& voice,
const UtteranceContinuousParameters& params) = 0;
virtual bool Speak(int utterance_id,
const std::string& utterance,
const std::string& lang,
const VoiceData& voice,
const UtteranceContinuousParameters& params) = 0;
// Stop speaking immediately and return true on success.
virtual bool StopSpeaking() = 0;

View file

@ -27,8 +27,7 @@ class SecurityStateTabHelper
~SecurityStateTabHelper() override;
// See security_state::GetSecurityInfo.
void GetSecurityInfo(
security_state::SecurityInfo* result) const;
void GetSecurityInfo(security_state::SecurityInfo* result) const;
// Called when the NavigationEntry's SSLStatus or other security
// information changes.

View file

@ -13,7 +13,7 @@ class SkBitmap;
namespace content {
class ColorChooser;
class WebContents;
}
} // namespace content
namespace chrome {

View file

@ -16,7 +16,7 @@ class WebContents;
namespace views {
class ColorChooserView;
class Widget;
}
} // namespace views
// TODO(mukai): rename this as -Ash and move to c/b/ui/ash after Linux-aura
// switches to its native color chooser.

View file

@ -36,10 +36,16 @@ class GlobalMenuBarRegistrarX11 {
void RegisterXID(unsigned long xid);
void UnregisterXID(unsigned long xid);
CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11, void, OnProxyCreated,
GObject*, GAsyncResult*);
CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11, void, OnNameOwnerChanged,
GObject*, GParamSpec*);
CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11,
void,
OnProxyCreated,
GObject*,
GAsyncResult*);
CHROMEG_CALLBACK_1(GlobalMenuBarRegistrarX11,
void,
OnNameOwnerChanged,
GObject*,
GParamSpec*);
GDBusProxy* registrar_proxy_;