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

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

Issue 2758323002: Broke out layout metric information from ViewsDelegate to LayoutProvider (Closed)
Patch Set: Final feedback addressed Created 3 years, 8 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 (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/metrics/user_metrics.h" 10 #include "base/metrics/user_metrics.h"
11 #include "base/strings/string16.h" 11 #include "base/strings/string16.h"
12 #include "base/strings/string_util.h" 12 #include "base/strings/string_util.h"
13 #include "base/strings/utf_string_conversions.h" 13 #include "base/strings/utf_string_conversions.h"
14 #include "chrome/app/chrome_command_ids.h" 14 #include "chrome/app/chrome_command_ids.h"
15 #include "chrome/browser/bookmarks/bookmark_model_factory.h" 15 #include "chrome/browser/bookmarks/bookmark_model_factory.h"
16 #include "chrome/browser/platform_util.h" 16 #include "chrome/browser/platform_util.h"
17 #include "chrome/browser/profiles/profile.h" 17 #include "chrome/browser/profiles/profile.h"
18 #include "chrome/browser/ui/bookmarks/bookmark_bubble_observer.h" 18 #include "chrome/browser/ui/bookmarks/bookmark_bubble_observer.h"
19 #include "chrome/browser/ui/bookmarks/bookmark_editor.h" 19 #include "chrome/browser/ui/bookmarks/bookmark_editor.h"
20 #include "chrome/browser/ui/browser_dialogs.h" 20 #include "chrome/browser/ui/browser_dialogs.h"
21 #include "chrome/browser/ui/sync/sync_promo_ui.h" 21 #include "chrome/browser/ui/sync/sync_promo_ui.h"
22 #include "chrome/browser/ui/views/harmony/layout_delegate.h" 22 #include "chrome/browser/ui/views/harmony/chrome_layout_provider.h"
23 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h" 23 #include "chrome/browser/ui/views/sync/bubble_sync_promo_view.h"
24 #include "chrome/grit/chromium_strings.h" 24 #include "chrome/grit/chromium_strings.h"
25 #include "chrome/grit/generated_resources.h" 25 #include "chrome/grit/generated_resources.h"
26 #include "components/bookmarks/browser/bookmark_model.h" 26 #include "components/bookmarks/browser/bookmark_model.h"
27 #include "components/bookmarks/browser/bookmark_utils.h" 27 #include "components/bookmarks/browser/bookmark_utils.h"
28 #include "components/strings/grit/components_strings.h" 28 #include "components/strings/grit/components_strings.h"
29 #include "ui/accessibility/ax_node_data.h" 29 #include "ui/accessibility/ax_node_data.h"
30 #include "ui/base/l10n/l10n_util.h" 30 #include "ui/base/l10n/l10n_util.h"
31 #include "ui/events/keycodes/keyboard_codes.h" 31 #include "ui/events/keycodes/keyboard_codes.h"
32 #include "ui/views/bubble/bubble_frame_view.h" 32 #include "ui/views/bubble/bubble_frame_view.h"
(...skipping 147 matching lines...) Expand 10 before | Expand all | Expand 10 after
180 180
181 SetLayoutManager(new views::FillLayout); 181 SetLayoutManager(new views::FillLayout);
182 bookmark_details_view_ = base::MakeUnique<View>(); 182 bookmark_details_view_ = base::MakeUnique<View>();
183 GridLayout* layout = new GridLayout(bookmark_details_view_.get()); 183 GridLayout* layout = new GridLayout(bookmark_details_view_.get());
184 bookmark_details_view_->SetLayoutManager(layout); 184 bookmark_details_view_->SetLayoutManager(layout);
185 185
186 // This column set is used for the labels and textfields as well as the 186 // This column set is used for the labels and textfields as well as the
187 // buttons at the bottom. 187 // buttons at the bottom.
188 const int cs_id = 0; 188 const int cs_id = 0;
189 ColumnSet* cs = layout->AddColumnSet(cs_id); 189 ColumnSet* cs = layout->AddColumnSet(cs_id);
190 cs->AddColumn(LayoutDelegate::Get()->GetControlLabelGridAlignment(), 190 cs->AddColumn(ChromeLayoutProvider::Get()->GetControlLabelGridAlignment(),
191 GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0); 191 GridLayout::CENTER, 0, GridLayout::USE_PREF, 0, 0);
192 cs->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing); 192 cs->AddPaddingColumn(0, views::kUnrelatedControlHorizontalSpacing);
193 193
194 cs->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0, 194 cs->AddColumn(GridLayout::FILL, GridLayout::CENTER, 0,
195 GridLayout::USE_PREF, 0, 0); 195 GridLayout::USE_PREF, 0, 0);
196 cs->AddPaddingColumn(1, views::kUnrelatedControlLargeHorizontalSpacing); 196 cs->AddPaddingColumn(1, views::kUnrelatedControlLargeHorizontalSpacing);
197 197
198 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0, 198 cs->AddColumn(GridLayout::LEADING, GridLayout::TRAILING, 0,
199 GridLayout::USE_PREF, 0, 0); 199 GridLayout::USE_PREF, 0, 0);
200 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing); 200 cs->AddPaddingColumn(0, views::kRelatedButtonHSpacing);
(...skipping 206 matching lines...) Expand 10 before | Expand all | Expand 10 after
407 RemoveChildView(bookmark_details_view_.get()); 407 RemoveChildView(bookmark_details_view_.get());
408 is_showing_ios_promotion_ = true; 408 is_showing_ios_promotion_ = true;
409 ios_promo_view_ = new DesktopIOSPromotionBubbleView( 409 ios_promo_view_ = new DesktopIOSPromotionBubbleView(
410 profile_, desktop_ios_promotion::PromotionEntryPoint::BOOKMARKS_BUBBLE); 410 profile_, desktop_ios_promotion::PromotionEntryPoint::BOOKMARKS_BUBBLE);
411 AddChildView(ios_promo_view_); 411 AddChildView(ios_promo_view_);
412 GetWidget()->UpdateWindowIcon(); 412 GetWidget()->UpdateWindowIcon();
413 GetWidget()->UpdateWindowTitle(); 413 GetWidget()->UpdateWindowTitle();
414 SizeToContents(); 414 SizeToContents();
415 } 415 }
416 #endif 416 #endif
OLDNEW
« no previous file with comments | « chrome/browser/ui/views/arc_app_dialog_view.cc ('k') | chrome/browser/ui/views/bookmarks/bookmark_editor_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698