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

Side by Side Diff: chrome/browser/ui/views/bookmarks/bookmark_bubble_view.cc

Issue 2556563005: views: add harmony control label alignment (Closed)
Patch Set: remove constant from views Created 4 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 unified diff | Download patch
« no previous file with comments | « no previous file | chrome/browser/ui/views/cookie_info_view.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h" 5 #include "chrome/browser/ui/views/bookmarks/bookmark_bubble_view.h"
6 6
7 #include <utility> 7 #include <utility>
8 8
9 #include "base/macros.h" 9 #include "base/macros.h"
10 #include "base/strings/string16.h" 10 #include "base/strings/string16.h"
11 #include "base/strings/string_util.h" 11 #include "base/strings/string_util.h"
12 #include "base/strings/utf_string_conversions.h" 12 #include "base/strings/utf_string_conversions.h"
13 #include "chrome/app/chrome_command_ids.h" 13 #include "chrome/app/chrome_command_ids.h"
14 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 14 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
15 #include "chrome/browser/platform_util.h" 15 #include "chrome/browser/platform_util.h"
16 #include "chrome/browser/profiles/profile.h" 16 #include "chrome/browser/profiles/profile.h"
17 #include "chrome/browser/ui/bookmarks/bookmark_bubble_observer.h" 17 #include "chrome/browser/ui/bookmarks/bookmark_bubble_observer.h"
18 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" 18 #include "chrome/browser/ui/bookmarks/bookmark_editor.h"
19 #include "chrome/browser/ui/browser_dialogs.h" 19 #include "chrome/browser/ui/browser_dialogs.h"
20 #include "chrome/browser/ui/sync/sync_promo_ui.h" 20 #include "chrome/browser/ui/sync/sync_promo_ui.h"
21 #include "chrome/browser/ui/views/harmony/layout_delegate.h"
21 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h" 22 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h"
22 #include "chrome/grit/chromium_strings.h" 23 #include "chrome/grit/chromium_strings.h"
23 #include "chrome/grit/generated_resources.h" 24 #include "chrome/grit/generated_resources.h"
24 #include "components/bookmarks/browser/bookmark_model.h" 25 #include "components/bookmarks/browser/bookmark_model.h"
25 #include "components/bookmarks/browser/bookmark_utils.h" 26 #include "components/bookmarks/browser/bookmark_utils.h"
26 #include "components/strings/grit/components_strings.h" 27 #include "components/strings/grit/components_strings.h"
27 #include "content/public/browser/user_metrics.h" 28 #include "content/public/browser/user_metrics.h"
28 #include "ui/accessibility/ax_node_data.h" 29 #include "ui/accessibility/ax_node_data.h"
29 #include "ui/base/l10n/l10n_util.h" 30 #include "ui/base/l10n/l10n_util.h"
30 #include "ui/events/keycodes/keyboard_codes.h" 31 #include "ui/events/keycodes/keyboard_codes.h"
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after
170 parent_combobox_->SetAccessibleName( 171 parent_combobox_->SetAccessibleName(
171 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_BUBBLE_FOLDER_TEXT)); 172 l10n_util::GetStringUTF16(IDS_BOOKMARK_AX_BUBBLE_FOLDER_TEXT));
172 173
173 GridLayout* layout = new GridLayout(this); 174 GridLayout* layout = new GridLayout(this);
174 SetLayoutManager(layout); 175 SetLayoutManager(layout);
175 176
176 // This column set is used for the labels and textfields as well as the 177 // This column set is used for the labels and textfields as well as the
177 // buttons at the bottom. 178 // buttons at the bottom.
178 const int cs_id = 0; 179 const int cs_id = 0;
179 ColumnSet* cs = layout->AddColumnSet(cs_id); 180 ColumnSet* cs = layout->AddColumnSet(cs_id);
180 cs->AddColumn(views::kControlLabelGridAlignment, GridLayout::CENTER, 0, 181 cs->AddColumn(LayoutDelegate::Get()->GetControlLabelGridAlignment(),
181 GridLayout::USE_PREF, 0, 0); 182 GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0);
182 cs->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing); 183 cs->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing);
183 184
184 cs->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, 185 cs->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0,
185 GridLayout::USE_PREF, 0, 0); 186 GridLayout::USE_PREF, 0, 0);
186 cs->AddPaddingColumn(1, views::kUnrelatedControlLargeHorizontalSpacing); 187 cs->AddPaddingColumn(1, views::kUnrelatedControlLargeHorizontalSpacing);
187 188
188 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0, 189 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
189 GridLayout::USE_PREF, 0, 0); 190 GridLayout::USE_PREF, 0, 0);
190 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing); 191 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
191 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0, 192 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
(...skipping 153 matching lines...) Expand 10 before | Expand all | Expand 10 after
345 if (node) { 346 if (node) {
346 const base::string16 new_title = title_tf_->text(); 347 const base::string16 new_title = title_tf_->text();
347 if (new_title != node->GetTitle()) { 348 if (new_title != node->GetTitle()) {
348 model->SetTitle(node, new_title); 349 model->SetTitle(node, new_title);
349 content::RecordAction( 350 content::RecordAction(
350 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble")); 351 UserMetricsAction("BookmarkBubble_ChangeTitleInBubble"));
351 } 352 }
352 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index()); 353 parent_model_.MaybeChangeParent(node, parent_combobox_->selected_index());
353 } 354 }
354 } 355 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/cookie_info_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698