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

Side by Side Diff: chrome/browser/ui/cocoa/browser_window_controller.h

Issue 151283006: Mac OS X: Show the Translate icon on Omnibox (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@issue-307352-translate-bubble-2
Patch Set: . Created 6 years, 10 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 unified diff | Download patch
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 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 5 #ifndef CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 6 #define CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
7 7
8 // A class acting as the Objective-C controller for the Browser 8 // A class acting as the Objective-C controller for the Browser
9 // object. Handles interactions between Cocoa and the cross-platform 9 // object. Handles interactions between Cocoa and the cross-platform
10 // code. Each window has a single toolbar and, by virtue of being a 10 // code. Each window has a single toolbar and, by virtue of being a
11 // TabWindowController, a tab strip along the top. 11 // TabWindowController, a tab strip along the top.
12 12
13 #import <Cocoa/Cocoa.h> 13 #import <Cocoa/Cocoa.h>
14 14
15 #include "base/mac/scoped_nsobject.h" 15 #include "base/mac/scoped_nsobject.h"
16 #include "base/memory/scoped_ptr.h" 16 #include "base/memory/scoped_ptr.h"
17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h" 17 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bar_controller.h"
18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h" 18 #import "chrome/browser/ui/cocoa/bookmarks/bookmark_bubble_controller.h"
19 #import "chrome/browser/ui/cocoa/browser_command_executor.h" 19 #import "chrome/browser/ui/cocoa/browser_command_executor.h"
20 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h" 20 #import "chrome/browser/ui/cocoa/fullscreen_exit_bubble_controller.h"
21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h" 21 #import "chrome/browser/ui/cocoa/tabs/tab_strip_controller.h"
22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h" 22 #import "chrome/browser/ui/cocoa/tabs/tab_window_controller.h"
23 #import "chrome/browser/ui/cocoa/themed_window.h" 23 #import "chrome/browser/ui/cocoa/themed_window.h"
24 #import "chrome/browser/ui/cocoa/url_drop_target.h" 24 #import "chrome/browser/ui/cocoa/url_drop_target.h"
25 #import "chrome/browser/ui/cocoa/view_resizer.h" 25 #import "chrome/browser/ui/cocoa/view_resizer.h"
26 #include "chrome/browser/ui/translate/translate_bubble_model.h"
27 #include "components/translate/core/common/translate_errors.h"
26 #include "ui/gfx/rect.h" 28 #include "ui/gfx/rect.h"
27 29
28 @class AvatarBaseController; 30 @class AvatarBaseController;
29 class Browser; 31 class Browser;
30 class BrowserWindow; 32 class BrowserWindow;
31 class BrowserWindowCocoa; 33 class BrowserWindowCocoa;
32 @class DevToolsController; 34 @class DevToolsController;
33 @class DownloadShelfController; 35 @class DownloadShelfController;
34 class ExtensionKeybindingRegistryCocoa; 36 class ExtensionKeybindingRegistryCocoa;
35 @class FindBarCocoaController; 37 @class FindBarCocoaController;
(...skipping 193 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 - (AvatarBaseController*)avatarButtonController; 231 - (AvatarBaseController*)avatarButtonController;
230 232
231 // Forces the toolbar (and transitively the location bar) to update its current 233 // Forces the toolbar (and transitively the location bar) to update its current
232 // state. If |tab| is non-NULL, we're switching (back?) to this tab and should 234 // state. If |tab| is non-NULL, we're switching (back?) to this tab and should
233 // restore any previous location bar state (such as user editing) as well. 235 // restore any previous location bar state (such as user editing) as well.
234 - (void)updateToolbarWithContents:(content::WebContents*)tab; 236 - (void)updateToolbarWithContents:(content::WebContents*)tab;
235 237
236 // Sets whether or not the current page in the frontmost tab is bookmarked. 238 // Sets whether or not the current page in the frontmost tab is bookmarked.
237 - (void)setStarredState:(BOOL)isStarred; 239 - (void)setStarredState:(BOOL)isStarred;
238 240
241 // Sets whether or not the current page is translated.
242 - (void)setTranslateIconToggled:(BOOL)on;
Nico 2014/02/05 06:07:18 setTranslateIconVisible? setCurrentPageIsTranslate
hajimehoshi 2014/02/05 11:08:03 Done.
243
239 // Happens when the zoom level is changed in the active tab, the active tab is 244 // Happens when the zoom level is changed in the active tab, the active tab is
240 // changed, or a new browser window or tab is created. |canShowBubble| denotes 245 // changed, or a new browser window or tab is created. |canShowBubble| denotes
241 // whether it would be appropriate to show a zoom bubble or not. 246 // whether it would be appropriate to show a zoom bubble or not.
242 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble; 247 - (void)zoomChangedForActiveTab:(BOOL)canShowBubble;
243 248
244 // Return the rect, in WebKit coordinates (flipped), of the window's grow box 249 // Return the rect, in WebKit coordinates (flipped), of the window's grow box
245 // in the coordinate system of the content area of the currently selected tab. 250 // in the coordinate system of the content area of the currently selected tab.
246 - (NSRect)selectedTabGrowBoxRect; 251 - (NSRect)selectedTabGrowBoxRect;
247 252
248 // Called to tell the selected tab to update its loading state. 253 // Called to tell the selected tab to update its loading state.
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 // an extension command and returns YES if so (NO otherwise). 307 // an extension command and returns YES if so (NO otherwise).
303 - (BOOL)handledByExtensionCommand:(NSEvent*)event; 308 - (BOOL)handledByExtensionCommand:(NSEvent*)event;
304 309
305 // Delegate method for the status bubble to query its base frame. 310 // Delegate method for the status bubble to query its base frame.
306 - (NSRect)statusBubbleBaseFrame; 311 - (NSRect)statusBubbleBaseFrame;
307 312
308 // Show the bookmark bubble (e.g. user just clicked on the STAR) 313 // Show the bookmark bubble (e.g. user just clicked on the STAR)
309 - (void)showBookmarkBubbleForURL:(const GURL&)url 314 - (void)showBookmarkBubbleForURL:(const GURL&)url
310 alreadyBookmarked:(BOOL)alreadyBookmarked; 315 alreadyBookmarked:(BOOL)alreadyBookmarked;
311 316
317 // Show the translate bubble.
318 - (void)showTranslateBubbleForWebContents:(content::WebContents*)contents
319 viewState:(TranslateBubbleModel::
320 ViewState)viewState
321 errorType:(TranslateErrors::Type)errorType;
322
312 // Shows or hides the docked web inspector depending on |contents|'s state. 323 // Shows or hides the docked web inspector depending on |contents|'s state.
313 - (void)updateDevToolsForContents:(content::WebContents*)contents; 324 - (void)updateDevToolsForContents:(content::WebContents*)contents;
314 325
315 // Gets the current theme provider. 326 // Gets the current theme provider.
316 - (ui::ThemeProvider*)themeProvider; 327 - (ui::ThemeProvider*)themeProvider;
317 328
318 // Gets the window style. 329 // Gets the window style.
319 - (ThemedWindowStyle)themedWindowStyle; 330 - (ThemedWindowStyle)themedWindowStyle;
320 331
321 // Returns the position in the coordinates of the root view 332 // Returns the position in the coordinates of the root view
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after
503 // positioned relative to. 514 // positioned relative to.
504 - (NSRect)omniboxPopupAnchorRect; 515 - (NSRect)omniboxPopupAnchorRect;
505 516
506 // Force a layout of info bars. 517 // Force a layout of info bars.
507 - (void)layoutInfoBars; 518 - (void)layoutInfoBars;
508 519
509 @end // @interface BrowserWindowController (TestingAPI) 520 @end // @interface BrowserWindowController (TestingAPI)
510 521
511 522
512 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_ 523 #endif // CHROME_BROWSER_UI_COCOA_BROWSER_WINDOW_CONTROLLER_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698