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

Unified Diff: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm

Issue 11786003: Move Icons out of Extension class (Closed) Base URL: http://git.chromium.org/chromium/src.git@dc_unref_browser_action
Patch Set: License year update Created 7 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 side-by-side diff with in-line comments
Download patch
Index: chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
index 8d1d4edefb5b63fe50a9aa54ee98a314865f8421..03a1c9475d5c8b172e01f3094e7e9a6acf9172cd 100644
--- a/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/page_action_decoration.mm
@@ -1,4 +1,4 @@
-// Copyright (c) 2012 The Chromium Authors. All rights reserved.
+// Copyright (c) 2013 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
@@ -23,6 +23,7 @@
#include "chrome/browser/ui/omnibox/location_bar_util.h"
#include "chrome/browser/ui/webui/extensions/extension_info_ui.h"
#include "chrome/common/chrome_notification_types.h"
+#include "chrome/common/extensions/api/icons/icons_handler.h"
#include "chrome/common/extensions/extension_resource.h"
#include "content/public/browser/notification_service.h"
#include "content/public/browser/web_contents.h"
@@ -80,7 +81,7 @@ PageActionDecoration::~PageActionDecoration() {}
// Always |kPageActionIconMaxSize| wide. |ImageDecoration| draws the
// image centered.
CGFloat PageActionDecoration::GetWidthForSpace(CGFloat width) {
- return Extension::kPageActionIconMaxSize;
+ return extensions::IconsInfo::kPageActionIconMaxSize;
}
void PageActionDecoration::DrawWithBackgroundInFrame(NSRect background_frame,
@@ -176,8 +177,9 @@ void PageActionDecoration::UpdateVisibility(WebContents* contents,
if (!icon.IsEmpty()) {
SetImage(icon.ToNSImage());
} else if (!GetImage()) {
- const NSSize default_size = NSMakeSize(Extension::kPageActionIconMaxSize,
- Extension::kPageActionIconMaxSize);
+ const NSSize default_size = NSMakeSize(
+ extensions::IconsInfo::kPageActionIconMaxSize,
+ extensions::IconsInfo::kPageActionIconMaxSize);
SetImage([[[NSImage alloc] initWithSize:default_size] autorelease]);
}
}
@@ -211,7 +213,7 @@ NSPoint PageActionDecoration::GetBubblePointInFrame(NSRect frame) {
// easier (the middle of the centered image is the middle of the
// frame).
const CGFloat delta_height =
- NSHeight(frame) - Extension::kPageActionIconMaxSize;
+ NSHeight(frame) - extensions::IconsInfo::kPageActionIconMaxSize;
const CGFloat bottom_inset = std::ceil(delta_height / 2.0);
// Return a point just below the bottom of the maximal drawing area.

Powered by Google App Engine
This is Rietveld 408576698