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

Unified Diff: chrome/browser/chromeos/status_area_view.cc

Issue 449050: Implement "Language Switcher" for Chromium OS. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
Patch Set: '' Created 11 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « chrome/browser/chromeos/status_area_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/chromeos/status_area_view.cc
===================================================================
--- chrome/browser/chromeos/status_area_view.cc (revision 33958)
+++ chrome/browser/chromeos/status_area_view.cc (working copy)
@@ -14,6 +14,7 @@
#include "chrome/browser/browser.h"
#include "chrome/browser/browser_window.h"
#include "chrome/browser/chromeos/clock_menu_button.h"
+#include "chrome/browser/chromeos/language_menu_button.h"
#include "chrome/browser/chromeos/network_menu_button.h"
#include "chrome/browser/chromeos/power_menu_button.h"
#include "chrome/browser/chromeos/status_area_button.h"
@@ -37,6 +38,9 @@
const int kLeftBorder = 1;
// Number of pixels to separate the clock from the next item on the right.
const int kClockSeparation = 4;
+// Number of pixels to separate the language selector from the next item
+// on the right.
+const int kLanguageSeparation = 4;
// BrowserWindowGtk tiles its image with this offset
const int kCustomFrameBackgroundVerticalOffset = 15;
@@ -126,6 +130,7 @@
: browser_(browser),
window_(window),
clock_view_(NULL),
+ language_view_(NULL),
network_view_(NULL),
battery_view_(NULL),
menu_view_(NULL) {
@@ -134,6 +139,10 @@
void StatusAreaView::Init() {
ThemeProvider* theme = browser_->profile()->GetThemeProvider();
+ // Language.
+ language_view_ = new LanguageMenuButton(browser_);
+ AddChildView(language_view_);
+
// Clock.
clock_view_ = new ClockMenuButton(browser_);
AddChildView(clock_view_);
@@ -164,7 +173,7 @@
gfx::Size StatusAreaView::GetPreferredSize() {
// Start with padding.
- int result_w = kLeftBorder + kClockSeparation;
+ int result_w = kLeftBorder + kClockSeparation + kLanguageSeparation;
int result_h = 0;
for (int i = 0; i < GetChildViewCount(); i++) {
views::View* cur = GetChildViewAt(i);
@@ -195,9 +204,11 @@
cur_x += cur_size.width();
- // Buttons have built in padding, but clock doesn't.
+ // Buttons have built in padding, but clock and language status don't.
if (cur == clock_view_)
cur_x += kClockSeparation;
+ else if (cur == language_view_)
+ cur_x += kLanguageSeparation;
}
}
}
« no previous file with comments | « chrome/browser/chromeos/status_area_view.h ('k') | chrome/chrome_browser.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698