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

Side by Side Diff: chrome/browser/ui/views/profiles/profile_chooser_view.cc

Issue 2701693003: Revert of Linux/Windows: Remove NonInteractiveContainer from the profile chooser. (Closed)
Patch Set: Created 3 years, 10 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2014 The Chromium Authors. All rights reserved. 1 // Copyright 2014 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/profiles/profile_chooser_view.h" 5 #include "chrome/browser/ui/views/profiles/profile_chooser_view.h"
6 6
7 #include "base/macros.h" 7 #include "base/macros.h"
8 #include "base/metrics/user_metrics.h" 8 #include "base/metrics/user_metrics.h"
9 #include "base/strings/utf_string_conversions.h" 9 #include "base/strings/utf_string_conversions.h"
10 #include "chrome/browser/browser_process.h" 10 #include "chrome/browser/browser_process.h"
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after
233 public: 233 public:
234 explicit SizedContainer(const gfx::Size& preferred_size) 234 explicit SizedContainer(const gfx::Size& preferred_size)
235 : preferred_size_(preferred_size) {} 235 : preferred_size_(preferred_size) {}
236 236
237 gfx::Size GetPreferredSize() const override { return preferred_size_; } 237 gfx::Size GetPreferredSize() const override { return preferred_size_; }
238 238
239 private: 239 private:
240 gfx::Size preferred_size_; 240 gfx::Size preferred_size_;
241 }; 241 };
242 242
243 // NonInteractiveContainer -------------------------------------------------
244
245 // A simple container view that does not process events within subtree.
246 class NonInteractiveContainer : public views::View {
247 public:
248 NonInteractiveContainer() {}
249
250 // views::CanProcessEventsWithinSubtree:
251 bool CanProcessEventsWithinSubtree() const override { return false; }
252
253 private:
254 DISALLOW_COPY_AND_ASSIGN(NonInteractiveContainer);
255 };
256
243 // A view to host the GAIA webview overlapped with a back button. This class 257 // A view to host the GAIA webview overlapped with a back button. This class
244 // is needed to reparent the back button inside a native view so that on 258 // is needed to reparent the back button inside a native view so that on
245 // windows, user input can be be properly routed to the button. 259 // windows, user input can be be properly routed to the button.
246 class HostView : public views::View { 260 class HostView : public views::View {
247 public: 261 public:
248 HostView() {} 262 HostView() {}
249 263
250 private: 264 private:
251 // views::View: 265 // views::View:
252 void ViewHierarchyChanged( 266 void ViewHierarchyChanged(
(...skipping 1411 matching lines...) Expand 10 before | Expand all | Expand 10 after
1664 EditableProfilePhoto* current_profile_photo = new EditableProfilePhoto( 1678 EditableProfilePhoto* current_profile_photo = new EditableProfilePhoto(
1665 this, avatar_item.icon, !is_guest, browser_->profile()); 1679 this, avatar_item.icon, !is_guest, browser_->profile());
1666 1680
1667 // Profile name, left-aligned to the right of profile icon. 1681 // Profile name, left-aligned to the right of profile icon.
1668 views::Label* current_profile_name = new views::Label( 1682 views::Label* current_profile_name = new views::Label(
1669 profiles::GetAvatarNameForProfile(browser_->profile()->GetPath())); 1683 profiles::GetAvatarNameForProfile(browser_->profile()->GetPath()));
1670 current_profile_name->SetFontList( 1684 current_profile_name->SetFontList(
1671 ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta( 1685 ui::ResourceBundle::GetSharedInstance().GetFontListWithDelta(
1672 1, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::MEDIUM)); 1686 1, gfx::Font::FontStyle::NORMAL, gfx::Font::Weight::MEDIUM));
1673 current_profile_name->SetHorizontalAlignment(gfx::ALIGN_LEFT); 1687 current_profile_name->SetHorizontalAlignment(gfx::ALIGN_LEFT);
1674 views::View* profile_name_container = new views::View(); 1688 NonInteractiveContainer* profile_name_container =
1689 new NonInteractiveContainer();
1675 int name_container_v_spacing = 1690 int name_container_v_spacing =
1676 (current_profile_photo->GetPreferredSize().height() - 1691 (current_profile_photo->GetPreferredSize().height() -
1677 current_profile_name->GetPreferredSize().height()) / 2; 1692 current_profile_name->GetPreferredSize().height()) / 2;
1678 views::BoxLayout* profile_name_layout = new views::BoxLayout( 1693 views::BoxLayout* profile_name_layout = new views::BoxLayout(
1679 views::BoxLayout::kVertical, 0, name_container_v_spacing, 0); 1694 views::BoxLayout::kVertical, 0, name_container_v_spacing, 0);
1680 profile_name_container->SetLayoutManager(profile_name_layout); 1695 profile_name_container->SetLayoutManager(profile_name_layout);
1681 profile_name_container->AddChildView(current_profile_name); 1696 profile_name_container->AddChildView(current_profile_name);
1682 1697
1683 const int between_child_spacing = 1698 const int between_child_spacing =
1684 kMaterialMenuEdgeMargin - EditableProfilePhoto::badge_spacing(); 1699 kMaterialMenuEdgeMargin - EditableProfilePhoto::badge_spacing();
(...skipping 604 matching lines...) Expand 10 before | Expand all | Expand 10 after
2289 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) != 2304 IncognitoModePrefs::GetAvailability(browser_->profile()->GetPrefs()) !=
2290 IncognitoModePrefs::DISABLED; 2305 IncognitoModePrefs::DISABLED;
2291 return incognito_available && !browser_->profile()->IsGuestSession(); 2306 return incognito_available && !browser_->profile()->IsGuestSession();
2292 } 2307 }
2293 2308
2294 void ProfileChooserView::PostActionPerformed( 2309 void ProfileChooserView::PostActionPerformed(
2295 ProfileMetrics::ProfileDesktopMenu action_performed) { 2310 ProfileMetrics::ProfileDesktopMenu action_performed) {
2296 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_); 2311 ProfileMetrics::LogProfileDesktopMenu(action_performed, gaia_service_type_);
2297 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE; 2312 gaia_service_type_ = signin::GAIA_SERVICE_TYPE_NONE;
2298 } 2313 }
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698