Skip to content

Commit

Permalink
Cleanup: Fix some lint/style errors in extensions code.
Browse files Browse the repository at this point in the history
Review URL: https://codereview.chromium.org/149213003

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@247680 0039d316-1c4b-4281-b951-d872f2087c98
  • Loading branch information
thestig@chromium.org committed Jan 29, 2014
1 parent 290ed47 commit 4442454
Show file tree
Hide file tree
Showing 16 changed files with 17 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@
#include "chrome/common/content_settings.h"
#include "chrome/common/content_settings_pattern.h"
#include "extensions/browser/extension_prefs_scope.h"
#include "url/gurl.h"

namespace base {
class ListValue;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#include "chrome/browser/content_settings/content_settings_utils.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

using ::testing::Mock;

Expand Down Expand Up @@ -51,7 +52,7 @@ ContentSetting GetContentSettingFromStore(
ContentSettingsType content_type,
const std::string& resource_identifier,
bool incognito) {
scoped_ptr<content_settings::RuleIterator> rule_iterator (
scoped_ptr<content_settings::RuleIterator> rule_iterator(
store->GetRuleIterator(content_type, resource_identifier, incognito));
scoped_ptr<base::Value> setting(
content_settings::GetContentSettingValueAndPatterns(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
#include "base/values.h"
#include "chrome/browser/extensions/api/declarative/declarative_rule.h"
#include "components/url_matcher/url_matcher.h"
#include "url/gurl.h"

namespace extensions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
#include "components/url_matcher/url_matcher.h"
#include "testing/gmock/include/gmock/gmock.h"
#include "testing/gtest/include/gtest/gtest.h"
#include "url/gurl.h"

using testing::ElementsAre;
using testing::HasSubstr;
Expand Down
2 changes: 0 additions & 2 deletions chrome/browser/extensions/api/permissions/permissions_api.cc
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,6 @@
#include "extensions/common/permissions/permission_message_provider.h"
#include "extensions/common/permissions/permissions_data.h"
#include "extensions/common/permissions/permissions_info.h"
#include "extensions/common/url_pattern_set.h"
#include "url/gurl.h"

namespace extensions {

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
#include "extensions/common/extension.h"
#include "extensions/common/permissions/api_permission.h"
#include "google_apis/gaia/gaia_constants.h"
#include "url/gurl.h"

using content::BrowserThread;

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/api/tabs/tabs_constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,9 @@ extern const char kFocusedKey[];
extern const char kFormatKey[];
extern const char kFromIndexKey[];
extern const char kHeightKey[];
extern const char kHighlightedKey[];
extern const char kIdKey[];
extern const char kIncognitoKey[];
extern const char kIndexKey[];
extern const char kLastFocusedWindowKey[];
extern const char kLeftKey[];
Expand All @@ -34,7 +36,6 @@ extern const char kOldWindowIdKey[];
extern const char kOpenerTabIdKey[];
extern const char kPinnedKey[];
extern const char kQualityKey[];
extern const char kHighlightedKey[];
extern const char kRunAtKey[];
extern const char kSelectedKey[];
extern const char kShowStateKey[];
Expand All @@ -46,10 +47,9 @@ extern const char kTitleKey[];
extern const char kToIndexKey[];
extern const char kTopKey[];
extern const char kUrlKey[];
extern const char kWindowClosing[];
extern const char kWidthKey[];
extern const char kWindowClosing[];
extern const char kWindowIdKey[];
extern const char kIncognitoKey[];
extern const char kWindowTypeKey[];
extern const char kWindowTypeLongKey[];

Expand Down
6 changes: 3 additions & 3 deletions chrome/browser/extensions/extension_tab_util.cc
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ WindowController* GetShellWindowController(const WebContents* contents) {
registry->GetShellWindowForRenderViewHost(contents->GetRenderViewHost());
if (!shell_window)
return NULL;
return WindowControllerList::GetInstance()->
FindWindowById(shell_window->session_id().id());
return WindowControllerList::GetInstance()->FindWindowById(
shell_window->session_id().id());
}

} // namespace
Expand Down Expand Up @@ -95,7 +95,7 @@ base::DictionaryValue* ExtensionTabUtil::CreateTabValue(
(!extension || controller->IsVisibleToExtension(extension))) {
return controller->CreateTabValue(extension, tab_index);
}
base::DictionaryValue *result =
base::DictionaryValue* result =
CreateTabValue(contents, tab_strip, tab_index);
ScrubTabValueForExtension(contents, extension, result);
return result;
Expand Down
5 changes: 0 additions & 5 deletions chrome/common/extensions/mime_types_handler.cc
Original file line number Diff line number Diff line change
Expand Up @@ -5,18 +5,13 @@
#include "chrome/common/extensions/mime_types_handler.h"

#include "base/logging.h"
#include "base/strings/string_number_conversions.h"
#include "base/strings/string_util.h"
#include "base/strings/utf_string_conversions.h"
#include "base/values.h"
#include "chrome/common/extensions/extension_constants.h"
#include "content/public/common/url_constants.h"
#include "extensions/common/error_utils.h"
#include "extensions/common/manifest.h"
#include "extensions/common/manifest_constants.h"
#include "extensions/common/url_pattern.h"
#include "url/gurl.h"
#include "url/url_util.h"

namespace keys = extensions::manifest_keys;
namespace errors = extensions::manifest_errors;
Expand Down
5 changes: 0 additions & 5 deletions chrome/common/extensions/mime_types_handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@
#include "base/basictypes.h"
#include "extensions/common/extension.h"
#include "extensions/common/manifest_handler.h"
#include "extensions/common/url_pattern.h"
#include "extensions/common/url_pattern_set.h"
#include "url/gurl.h"

class URLPattern;

class MimeTypesHandler {
public:
Expand Down
15 changes: 3 additions & 12 deletions chrome/renderer/extensions/media_galleries_custom_bindings.cc
Original file line number Diff line number Diff line change
Expand Up @@ -19,20 +19,11 @@ namespace {
// FileSystemObject GetMediaFileSystem(string file_system_url): construct
// a file system object from a file system url.
void GetMediaFileSystemObject(const v8::FunctionCallbackInfo<v8::Value>& args) {
if (args.Length() != 1) {
NOTREACHED();
return;
}
if (!args[0]->IsString()) {
NOTREACHED();
return;
}
CHECK_EQ(1, args.Length());
CHECK(args[0]->IsString());

std::string fsid(*v8::String::Utf8Value(args[0]));
if (fsid.empty()) {
NOTREACHED();
return;
}
CHECK(!fsid.empty());

blink::WebFrame* webframe = blink::WebFrame::frameForCurrentContext();
const GURL origin = GURL(webframe->document().securityOrigin().toString());
Expand Down
1 change: 1 addition & 0 deletions chrome/renderer/extensions/send_request_natives.cc
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ void SendRequestNatives::GetNextRequestId(
// callback will be dispatched to EventBindings::HandleResponse.
void SendRequestNatives::StartRequest(
const v8::FunctionCallbackInfo<v8::Value>& args) {
CHECK_EQ(6, args.Length());
std::string name = *v8::String::Utf8Value(args[0]);
int request_id = args[2]->Int32Value();
bool has_callback = args[3]->BooleanValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ var Binding = require('binding').Binding;
var Event = require('event_bindings').Event;
var forEach = require('utils').forEach;
var renderViewObserverNatives = requireNative('renderViewObserverNatives');
var sendRequest = require('sendRequest').sendRequest;

var appWindowData = null;
var currentAppWindow = null;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
// Custom binding for the Media Gallery API.

var binding = require('binding').Binding.create('mediaGalleries');

var mediaGalleriesNatives = requireNative('mediaGalleries');
var blobNatives = requireNative('blob_natives');
var mediaGalleriesNatives = requireNative('mediaGalleries');

var mediaGalleriesMetadata = {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
var binding = require('binding').Binding.create('permissions');

var Event = require('event_bindings').Event;
var sendRequest = require('sendRequest').sendRequest;

// These custom binding are only necessary because it is not currently
// possible to have a union of types as the type of the items in an array.
Expand Down
9 changes: 3 additions & 6 deletions extensions/browser/extension_prefs.cc
Original file line number Diff line number Diff line change
Expand Up @@ -869,7 +869,6 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) {
PermissionsInfo* info = PermissionsInfo::GetInstance();
for (ExtensionIdList::const_iterator ext_id =
extension_ids.begin(); ext_id != extension_ids.end(); ++ext_id) {

// An extension's granted permissions need to be migrated if the
// full_access bit is present. This bit was always present in the previous
// scheme and is never present now.
Expand All @@ -887,15 +886,13 @@ void ExtensionPrefs::MigratePermissions(const ExtensionIdList& extension_ids) {
const base::ListValue* apis = NULL;
base::ListValue* new_apis = NULL;

std::string granted_apis =
JoinPrefs(kPrefGrantedPermissions, kPrefAPIs);
std::string granted_apis = JoinPrefs(kPrefGrantedPermissions, kPrefAPIs);
if (ext->GetList(kPrefOldGrantedAPIs, &apis))
new_apis = apis->DeepCopy();
else
new_apis = new base::ListValue();

std::string plugin_name = info->GetByID(
APIPermission::kPlugin)->name();
std::string plugin_name = info->GetByID(APIPermission::kPlugin)->name();
new_apis->Append(new base::StringValue(plugin_name));
UpdateExtensionPref(*ext_id, granted_apis, new_apis);
}
Expand Down Expand Up @@ -1671,7 +1668,7 @@ void ExtensionPrefs::SetGeometryCache(
}

const base::DictionaryValue* ExtensionPrefs::GetInstallSignature() {
return prefs_->GetDictionary(kInstallSignature);
return prefs_->GetDictionary(kInstallSignature);
}

void ExtensionPrefs::SetInstallSignature(
Expand Down

0 comments on commit 4442454

Please sign in to comment.