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

Side by Side Diff: chrome/browser/ui/cocoa/translate/translate_bubble_controller.h

Issue 203223002: Translate bubble for Mac OS X (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: groby's review Created 6 years, 9 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 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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 <Cocoa/Cocoa.h> 5 #import <Cocoa/Cocoa.h>
6 6
7 #include "base/mac/scoped_nsobject.h"
7 #include "base/memory/scoped_ptr.h" 8 #include "base/memory/scoped_ptr.h"
8 #include "chrome/browser/translate/translate_tab_helper.h" 9 #include "chrome/browser/translate/translate_tab_helper.h"
9 #import "chrome/browser/ui/cocoa/base_bubble_controller.h" 10 #import "chrome/browser/ui/cocoa/base_bubble_controller.h"
10 #include "components/translate/core/common/translate_errors.h" 11 #include "components/translate/core/common/translate_errors.h"
11 12
12 @class BrowserWindowController; 13 @class BrowserWindowController;
13 14
15 class LanguageComboboxModel;
14 class TranslateBubbleModel; 16 class TranslateBubbleModel;
17 class TranslateDenialComboboxModel;
15 18
16 namespace content { 19 namespace content {
17 class WebContents; 20 class WebContents;
18 } 21 }
19 22
20 // Displays the Translate bubble. The Translate bubble is a bubble which 23 // Displays the Translate bubble. The Translate bubble is a bubble which
21 // pops up when clicking the Translate icon on Omnibox. This bubble 24 // pops up when clicking the Translate icon on Omnibox. This bubble
22 // allows us to translate a foreign page into user-selected language, 25 // allows us to translate a foreign page into user-selected language,
23 // revert this, and configure the translate setting. 26 // revert this, and configure the translate setting.
24 @interface TranslateBubbleController : BaseBubbleController { 27 @interface TranslateBubbleController : BaseBubbleController {
25 @private 28 @private
26 content::WebContents* webContents_; 29 content::WebContents* webContents_;
27 scoped_ptr<TranslateBubbleModel> model_; 30 scoped_ptr<TranslateBubbleModel> model_;
28 31
32 base::scoped_nsobject<NSView> beforeTranslateView_;
33 base::scoped_nsobject<NSView> translatingView_;
34 base::scoped_nsobject<NSView> afterTranslateView_;
35 base::scoped_nsobject<NSView> errorView_;
36 base::scoped_nsobject<NSView> advancedView_;
37
38 NSButton* advancedDoneButton_;
groby-ooo-7-16 2014/03/25 18:49:05 Please add comment who owns those buttons.
hajimehoshi 2014/03/26 11:06:05 Done.
39 NSButton* advancedCancelButton_;
40 NSButton* alwaysTranslateCheckbox_;
41
42 scoped_ptr<TranslateDenialComboboxModel> translateDenialComboboxModel_;
43 scoped_ptr<LanguageComboboxModel> sourceLanguageComboboxModel_;
44 scoped_ptr<LanguageComboboxModel> targetLanguageComboboxModel_;
45
29 // Whether the translation is actually executed once at least. 46 // Whether the translation is actually executed once at least.
30 BOOL translateExecuted_; 47 BOOL translateExecuted_;
31 } 48 }
32 49
33 @property(readonly, nonatomic) const content::WebContents* webContents; 50 @property(readonly, nonatomic) const content::WebContents* webContents;
34 @property(readonly, nonatomic) const TranslateBubbleModel* model; 51 @property(readonly, nonatomic) const TranslateBubbleModel* model;
35 52
36 - (id)initWithParentWindow:(BrowserWindowController*)controller 53 - (id)initWithParentWindow:(BrowserWindowController*)controller
37 model:(scoped_ptr<TranslateBubbleModel>)model 54 model:(scoped_ptr<TranslateBubbleModel>)model
38 webContents:(content::WebContents*)webContents; 55 webContents:(content::WebContents*)webContents;
39 - (void)switchView:(TranslateBubbleModel::ViewState)viewState; 56 - (void)switchView:(TranslateBubbleModel::ViewState)viewState;
40 - (void)switchToErrorView:(TranslateErrors::Type)errorType; 57 - (void)switchToErrorView:(TranslateErrors::Type)errorType;
41 58
42 @end 59 @end
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698