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

Side by Side Diff: chrome/browser/ui/cocoa/extensions/browser_action_button.mm

Issue 803613002: [Extensions Toolbar Mac] Allow the overflow toolbar to use the theme provider (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/extensions/browser_actions_controller.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h" 5 #import "chrome/browser/ui/cocoa/extensions/browser_action_button.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 #include <cmath> 8 #include <cmath>
9 9
10 #include "base/logging.h" 10 #include "base/logging.h"
11 #include "base/strings/sys_string_conversions.h" 11 #include "base/strings/sys_string_conversions.h"
12 #include "chrome/browser/profiles/profile.h" 12 #include "chrome/browser/profiles/profile.h"
13 #include "chrome/browser/ui/browser.h" 13 #include "chrome/browser/ui/browser.h"
14 #include "chrome/browser/ui/browser_window.h"
14 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h" 15 #import "chrome/browser/ui/cocoa/extensions/browser_actions_controller.h"
15 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_contro ller.h" 16 #import "chrome/browser/ui/cocoa/extensions/extension_action_context_menu_contro ller.h"
17 #import "chrome/browser/ui/cocoa/themed_window.h"
16 #import "chrome/browser/ui/cocoa/toolbar/toolbar_action_view_delegate_cocoa.h" 18 #import "chrome/browser/ui/cocoa/toolbar/toolbar_action_view_delegate_cocoa.h"
17 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h" 19 #include "chrome/browser/ui/toolbar/toolbar_action_view_controller.h"
18 #include "grit/theme_resources.h" 20 #include "grit/theme_resources.h"
19 #include "skia/ext/skia_utils_mac.h" 21 #include "skia/ext/skia_utils_mac.h"
20 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h " 22 #import "third_party/google_toolbox_for_mac/src/AppKit/GTMNSAnimation+Duration.h "
21 #include "ui/gfx/canvas_skia_paint.h" 23 #include "ui/gfx/canvas_skia_paint.h"
22 #include "ui/gfx/image/image.h" 24 #include "ui/gfx/image/image.h"
23 #include "ui/gfx/rect.h" 25 #include "ui/gfx/rect.h"
24 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h" 26 #include "ui/gfx/scoped_ns_graphics_context_save_gstate_mac.h"
25 27
(...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 operation:NSCompositeSourceOver 396 operation:NSCompositeSourceOver
395 fraction:enabled ? 1.0 : 0.4 397 fraction:enabled ? 1.0 : 0.4
396 respectFlipped:YES 398 respectFlipped:YES
397 hints:nil]; 399 hints:nil];
398 400
399 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset; 401 cellFrame.origin.y += kBrowserActionBadgeOriginYOffset;
400 [self drawBadgeWithinFrame:cellFrame 402 [self drawBadgeWithinFrame:cellFrame
401 forWebContents:webContents]; 403 forWebContents:webContents];
402 } 404 }
403 405
406 - (ui::ThemeProvider*)themeProviderForWindow:(NSWindow*)window {
407 ui::ThemeProvider* themeProvider = [window themeProvider];
408 if (!themeProvider)
409 themeProvider =
410 [[browserActionsController_ browser]->window()->GetNativeWindow()
411 themeProvider];
412 return themeProvider;
413 }
414
404 @end 415 @end
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/extensions/browser_actions_controller.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698