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 #include "chrome/browser/ui/gtk/browser_titlebar.h" | 5 #include "chrome/browser/ui/gtk/browser_titlebar.h" |
6 | 6 |
7 #include <gdk/gdkkeysyms.h> | 7 #include <gdk/gdkkeysyms.h> |
8 #include <gtk/gtk.h> | 8 #include <gtk/gtk.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
11 #include <vector> | 11 #include <vector> |
12 | 12 |
13 #include "base/command_line.h" | 13 #include "base/command_line.h" |
14 #include "base/i18n/rtl.h" | 14 #include "base/i18n/rtl.h" |
15 #include "base/memory/singleton.h" | 15 #include "base/memory/singleton.h" |
16 #include "base/string_piece.h" | 16 #include "base/string_piece.h" |
17 #include "base/string_tokenizer.h" | 17 #include "base/strings/string_tokenizer.h" |
18 #include "base/utf_string_conversions.h" | 18 #include "base/utf_string_conversions.h" |
19 #include "chrome/app/chrome_command_ids.h" | 19 #include "chrome/app/chrome_command_ids.h" |
20 #include "chrome/browser/browser_process.h" | 20 #include "chrome/browser/browser_process.h" |
21 #include "chrome/browser/managed_mode/managed_mode.h" | 21 #include "chrome/browser/managed_mode/managed_mode.h" |
22 #include "chrome/browser/prefs/pref_service.h" | 22 #include "chrome/browser/prefs/pref_service.h" |
23 #include "chrome/browser/profiles/avatar_menu_model.h" | 23 #include "chrome/browser/profiles/avatar_menu_model.h" |
24 #include "chrome/browser/profiles/profile.h" | 24 #include "chrome/browser/profiles/profile.h" |
25 #include "chrome/browser/profiles/profile_info_cache.h" | 25 #include "chrome/browser/profiles/profile_info_cache.h" |
26 #include "chrome/browser/profiles/profile_manager.h" | 26 #include "chrome/browser/profiles/profile_manager.h" |
27 #include "chrome/browser/ui/browser.h" | 27 #include "chrome/browser/ui/browser.h" |
(...skipping 371 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
399 maximize_button_.reset(); | 399 maximize_button_.reset(); |
400 minimize_button_.reset(); | 400 minimize_button_.reset(); |
401 gtk_util::RemoveAllChildren(titlebar_left_buttons_vbox_); | 401 gtk_util::RemoveAllChildren(titlebar_left_buttons_vbox_); |
402 gtk_util::RemoveAllChildren(titlebar_right_buttons_vbox_); | 402 gtk_util::RemoveAllChildren(titlebar_right_buttons_vbox_); |
403 titlebar_left_buttons_hbox_ = NULL; | 403 titlebar_left_buttons_hbox_ = NULL; |
404 titlebar_right_buttons_hbox_ = NULL; | 404 titlebar_right_buttons_hbox_ = NULL; |
405 top_padding_left_ = NULL; | 405 top_padding_left_ = NULL; |
406 top_padding_right_ = NULL; | 406 top_padding_right_ = NULL; |
407 | 407 |
408 bool left_side = true; | 408 bool left_side = true; |
409 StringTokenizer tokenizer(button_string, ":,"); | 409 base::StringTokenizer tokenizer(button_string, ":,"); |
410 tokenizer.set_options(StringTokenizer::RETURN_DELIMS); | 410 tokenizer.set_options(base::StringTokenizer::RETURN_DELIMS); |
411 int left_count = 0; | 411 int left_count = 0; |
412 int right_count = 0; | 412 int right_count = 0; |
413 while (tokenizer.GetNext()) { | 413 while (tokenizer.GetNext()) { |
414 if (tokenizer.token_is_delim()) { | 414 if (tokenizer.token_is_delim()) { |
415 if (*tokenizer.token_begin() == ':') | 415 if (*tokenizer.token_begin() == ':') |
416 left_side = false; | 416 left_side = false; |
417 } else { | 417 } else { |
418 base::StringPiece token = tokenizer.token_piece(); | 418 base::StringPiece token = tokenizer.token_piece(); |
419 if (BuildButton(token.as_string(), left_side)) | 419 if (BuildButton(token.as_string(), left_side)) |
420 (left_side ? left_count : right_count)++; | 420 (left_side ? left_count : right_count)++; |
(...skipping 612 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1033 ui::SimpleMenuModel::Delegate* delegate) | 1033 ui::SimpleMenuModel::Delegate* delegate) |
1034 : SimpleMenuModel(delegate) { | 1034 : SimpleMenuModel(delegate) { |
1035 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); | 1035 AddItemWithStringId(IDC_NEW_TAB, IDS_TAB_CXMENU_NEWTAB); |
1036 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); | 1036 AddItemWithStringId(IDC_RESTORE_TAB, IDS_RESTORE_TAB); |
1037 AddSeparator(ui::NORMAL_SEPARATOR); | 1037 AddSeparator(ui::NORMAL_SEPARATOR); |
1038 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); | 1038 AddItemWithStringId(IDC_TASK_MANAGER, IDS_TASK_MANAGER); |
1039 AddSeparator(ui::NORMAL_SEPARATOR); | 1039 AddSeparator(ui::NORMAL_SEPARATOR); |
1040 AddCheckItemWithStringId(kShowWindowDecorationsCommand, | 1040 AddCheckItemWithStringId(kShowWindowDecorationsCommand, |
1041 IDS_SHOW_WINDOW_DECORATIONS_MENU); | 1041 IDS_SHOW_WINDOW_DECORATIONS_MENU); |
1042 } | 1042 } |
OLD | NEW |