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

Side by Side Diff: chrome/browser/gtk/translate/translate_infobar_base_gtk.h

Issue 4767001: Make TabContents own its infobar delegates.... (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 10 years, 1 month 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 | Annotate | Revision Log
OLDNEW
1 // Copyright (c) 2010 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2010 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_GTK_TRANSLATE_TRANSLATE_INFOBAR_BASE_GTK_H_ 5 #ifndef CHROME_BROWSER_GTK_TRANSLATE_TRANSLATE_INFOBAR_BASE_GTK_H_
6 #define CHROME_BROWSER_GTK_TRANSLATE_TRANSLATE_INFOBAR_BASE_GTK_H_ 6 #define CHROME_BROWSER_GTK_TRANSLATE_TRANSLATE_INFOBAR_BASE_GTK_H_
7 #pragma once 7 #pragma once
8 8
9 #include "chrome/browser/translate/translate_infobar_view.h" 9 #include "chrome/browser/translate/translate_infobar_view.h"
10 #include "chrome/browser/gtk/infobar_gtk.h" 10 #include "chrome/browser/gtk/infobar_gtk.h"
(...skipping 42 matching lines...) Expand 10 before | Expand all | Expand 10 after
53 // TranslateInfoDelegate) that should be selected initially. 53 // TranslateInfoDelegate) that should be selected initially.
54 // |exclude_language| is the language index of the language that should not be 54 // |exclude_language| is the language index of the language that should not be
55 // included in the list (-1 means no language excluded). 55 // included in the list (-1 means no language excluded).
56 GtkWidget* CreateLanguageCombobox(int selected_language, 56 GtkWidget* CreateLanguageCombobox(int selected_language,
57 int exclude_language); 57 int exclude_language);
58 58
59 // Given an above-constructed combobox, returns the currently selected 59 // Given an above-constructed combobox, returns the currently selected
60 // language id. 60 // language id.
61 static int GetLanguageComboboxActiveId(GtkComboBox* combo); 61 static int GetLanguageComboboxActiveId(GtkComboBox* combo);
62 62
63 // Convenience to retrieve the TranslateInfoBarDelegate for this infobar.
64 TranslateInfoBarDelegate* GetDelegate() const;
65
66 private: 63 private:
67 // Builds a button with an arrow in it to emulate the menu-button style from 64 // Builds a button with an arrow in it to emulate the menu-button style from
68 // the windows version. 65 // the windows version.
69 static GtkWidget* BuildOptionsMenuButton(); 66 static GtkWidget* BuildOptionsMenuButton();
70 67
71 // The menu displayed when the Options button is pressed. 68 // The menu displayed when the Options button is pressed.
72 scoped_ptr<OptionsMenuModel> options_menu_model_; 69 scoped_ptr<OptionsMenuModel> options_menu_model_;
73 scoped_ptr<MenuGtk> options_menu_menu_; 70 scoped_ptr<MenuGtk> options_menu_menu_;
74 71
75 CHROMEGTK_CALLBACK_0(TranslateInfoBarBase, void, OnOptionsClicked); 72 CHROMEGTK_CALLBACK_0(TranslateInfoBarBase, void, OnOptionsClicked);
76 73
77 // A percentage to average the normal page action background with the error 74 // A percentage to average the normal page action background with the error
78 // background. When 0, the infobar background should be pure PAGE_ACTION_TYPE. 75 // background. When 0, the infobar background should be pure PAGE_ACTION_TYPE.
79 // When 1, the infobar background should be pure WARNING_TYPE. 76 // When 1, the infobar background should be pure WARNING_TYPE.
80 double background_error_percent_; 77 double background_error_percent_;
81 78
82 // Changes the color of the background from normal to error color and back. 79 // Changes the color of the background from normal to error color and back.
83 scoped_ptr<SlideAnimation> background_color_animation_; 80 scoped_ptr<SlideAnimation> background_color_animation_;
84 81
85 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase); 82 DISALLOW_COPY_AND_ASSIGN(TranslateInfoBarBase);
86 }; 83 };
87 84
88 #endif // CHROME_BROWSER_GTK_TRANSLATE_TRANSLATE_INFOBAR_BASE_GTK_H_ 85 #endif // CHROME_BROWSER_GTK_TRANSLATE_TRANSLATE_INFOBAR_BASE_GTK_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698