| OLD | NEW |
| 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" |
| (...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 118 [[[BrowserWindowController browserWindowControllerForWindow: | 118 [[[BrowserWindowController browserWindowControllerForWindow: |
| 119 [controller_ browser]->window()->GetNativeWindow()] | 119 [controller_ browser]->window()->GetNativeWindow()] |
| 120 toolbarController] appMenuController]; | 120 toolbarController] appMenuController]; |
| 121 // If the app menu is open, we have to first close it. Part of this happens | 121 // If the app menu is open, we have to first close it. Part of this happens |
| 122 // asynchronously, so we have to use a posted task to open the next menu. | 122 // asynchronously, so we have to use a posted task to open the next menu. |
| 123 if ([appMenuController isMenuOpen]) | 123 if ([appMenuController isMenuOpen]) |
| 124 [appMenuController cancel]; | 124 [appMenuController cancel]; |
| 125 | 125 |
| 126 [controller_ toolbarActionsBar]->PopOutAction( | 126 [controller_ toolbarActionsBar]->PopOutAction( |
| 127 viewController_, | 127 viewController_, |
| 128 false, |
| 128 base::Bind(&ToolbarActionViewDelegateBridge::DoShowContextMenu, | 129 base::Bind(&ToolbarActionViewDelegateBridge::DoShowContextMenu, |
| 129 weakFactory_.GetWeakPtr())); | 130 weakFactory_.GetWeakPtr())); |
| 130 } | 131 } |
| 131 | 132 |
| 132 content::WebContents* ToolbarActionViewDelegateBridge::GetCurrentWebContents() | 133 content::WebContents* ToolbarActionViewDelegateBridge::GetCurrentWebContents() |
| 133 const { | 134 const { |
| 134 return [controller_ currentWebContents]; | 135 return [controller_ currentWebContents]; |
| 135 } | 136 } |
| 136 | 137 |
| 137 void ToolbarActionViewDelegateBridge::UpdateState() { | 138 void ToolbarActionViewDelegateBridge::UpdateState() { |
| (...skipping 434 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 572 - (const ui::ThemeProvider*)themeProviderForWindow:(NSWindow*)window { | 573 - (const ui::ThemeProvider*)themeProviderForWindow:(NSWindow*)window { |
| 573 const ui::ThemeProvider* themeProvider = [window themeProvider]; | 574 const ui::ThemeProvider* themeProvider = [window themeProvider]; |
| 574 if (!themeProvider) | 575 if (!themeProvider) |
| 575 themeProvider = | 576 themeProvider = |
| 576 [[browserActionsController_ browser]->window()->GetNativeWindow() | 577 [[browserActionsController_ browser]->window()->GetNativeWindow() |
| 577 themeProvider]; | 578 themeProvider]; |
| 578 return themeProvider; | 579 return themeProvider; |
| 579 } | 580 } |
| 580 | 581 |
| 581 @end | 582 @end |
| OLD | NEW |