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

Side by Side Diff: chrome/browser/ui/views/dropdown_bar_host.cc

Issue 1724333002: [MD] Don't allow overflowing location icons to appear on top of toolbar (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: streamline conditionals, add comments Created 4 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 | chrome/browser/ui/views/location_bar/location_bar_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/dropdown_bar_host.h" 5 #include "chrome/browser/ui/views/dropdown_bar_host.h"
6 6
7 #include <algorithm> 7 #include <algorithm>
8 8
9 #include "chrome/browser/ui/view_ids.h" 9 #include "chrome/browser/ui/view_ids.h"
10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h" 10 #include "chrome/browser/ui/views/dropdown_bar_host_delegate.h"
(...skipping 24 matching lines...) Expand all
35 void DropdownBarHost::Init(views::View* host_view, 35 void DropdownBarHost::Init(views::View* host_view,
36 views::View* view, 36 views::View* view,
37 DropdownBarHostDelegate* delegate) { 37 DropdownBarHostDelegate* delegate) {
38 DCHECK(view); 38 DCHECK(view);
39 DCHECK(delegate); 39 DCHECK(delegate);
40 40
41 view_ = view; 41 view_ = view;
42 delegate_ = delegate; 42 delegate_ = delegate;
43 43
44 // The |clip_view| exists to paint to a layer so that it can clip descendent 44 // The |clip_view| exists to paint to a layer so that it can clip descendent
45 // Views which also paint to a Layer. 45 // Views which also paint to a Layer. See http://crbug.com/589497
46 scoped_ptr<views::View> clip_view(new views::View()); 46 scoped_ptr<views::View> clip_view(new views::View());
47 clip_view->SetPaintToLayer(true); 47 clip_view->SetPaintToLayer(true);
48 clip_view->SetFillsBoundsOpaquely(false); 48 clip_view->SetFillsBoundsOpaquely(false);
49 clip_view->layer()->SetMasksToBounds(true); 49 clip_view->layer()->SetMasksToBounds(true);
50 clip_view->AddChildView(view_); 50 clip_view->AddChildView(view_);
51 51
52 // Initialize the host. 52 // Initialize the host.
53 host_.reset(new ThemeCopyingWidget(browser_view_->GetWidget())); 53 host_.reset(new ThemeCopyingWidget(browser_view_->GetWidget()));
54 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL); 54 views::Widget::InitParams params(views::Widget::InitParams::TYPE_CONTROL);
55 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 55 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
(...skipping 173 matching lines...) Expand 10 before | Expand all | Expand 10 after
229 escape, ui::AcceleratorManager::kNormalPriority, this); 229 escape, ui::AcceleratorManager::kNormalPriority, this);
230 esc_accel_target_registered_ = true; 230 esc_accel_target_registered_ = true;
231 } 231 }
232 232
233 void DropdownBarHost::UnregisterAccelerators() { 233 void DropdownBarHost::UnregisterAccelerators() {
234 DCHECK(esc_accel_target_registered_); 234 DCHECK(esc_accel_target_registered_);
235 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE); 235 ui::Accelerator escape(ui::VKEY_ESCAPE, ui::EF_NONE);
236 focus_manager_->UnregisterAccelerator(escape, this); 236 focus_manager_->UnregisterAccelerator(escape, this);
237 esc_accel_target_registered_ = false; 237 esc_accel_target_registered_ = false;
238 } 238 }
OLDNEW
« no previous file with comments | « no previous file | chrome/browser/ui/views/location_bar/location_bar_view.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698