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

Side by Side Diff: chrome/browser/ui/views/location_bar/location_bar_container_aura.cc

Issue 10907038: alternate ntp: clip middle omnibox when resizing browser window (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: re-implement fix Created 8 years, 3 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 | Annotate | Revision Log
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/location_bar/location_bar_container.h" 5 #include "chrome/browser/ui/views/location_bar/location_bar_container.h"
6 6
7 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" 7 #include "chrome/browser/ui/views/location_bar/location_bar_view.h"
8 8
9 void LocationBarContainer::SetInToolbar(bool in_toolbar) { 9 void LocationBarContainer::SetInToolbar(bool in_toolbar) {
10 if (animator_.IsAnimating()) 10 if (animator_.IsAnimating())
11 animator_.Cancel(); 11 animator_.Cancel();
12 // See comment in PlatformInit() as to why we do this. 12 // See comment in PlatformInit() as to why we do this.
13 SetPaintToLayer(!in_toolbar); 13 SetPaintToLayer(!in_toolbar);
14 if (!in_toolbar) { 14 if (!in_toolbar) {
15 layer()->SetFillsBoundsOpaquely(false); 15 layer()->SetFillsBoundsOpaquely(false);
16 layer()->SetMasksToBounds(true);
sky 2012/09/12 21:07:31 Add a comment why you need this.
kuan 2012/09/12 21:33:04 Done.
16 StackAtTop(); 17 StackAtTop();
17 } 18 }
18 } 19 }
19 20
20 void LocationBarContainer::OnFocus() { 21 void LocationBarContainer::OnFocus() {
21 } 22 }
22 23
23 void LocationBarContainer::PlatformInit() { 24 void LocationBarContainer::PlatformInit() {
24 view_parent_ = this; 25 view_parent_ = this;
25 // Ideally we would turn on layer painting here, but this poses problems with 26 // Ideally we would turn on layer painting here, but this poses problems with
26 // infobar arrows. So, instead we turn on the layer when animating and turn it 27 // infobar arrows. So, instead we turn on the layer when animating and turn it
27 // off when done. 28 // off when done.
28 } 29 }
29 30
30 // static 31 // static
31 SkColor LocationBarContainer::GetBackgroundColor() { 32 SkColor LocationBarContainer::GetBackgroundColor() {
32 return instant_extended_api_enabled_ ? 33 return instant_extended_api_enabled_ ?
33 SK_ColorWHITE : 34 SK_ColorWHITE :
34 LocationBarView::kOmniboxBackgroundColor; 35 LocationBarView::kOmniboxBackgroundColor;
35 } 36 }
36 37
37 void LocationBarContainer::StackAtTop() { 38 void LocationBarContainer::StackAtTop() {
38 // TODO: this is hack. The problem is NativeViewHostAura does an AddChild(), 39 // TODO: this is hack. The problem is NativeViewHostAura does an AddChild(),
39 // which places its layer at the top of the stack. 40 // which places its layer at the top of the stack.
40 if (layer()) 41 if (layer())
41 layer()->parent()->StackAtTop(layer()); 42 layer()->parent()->StackAtTop(layer());
42 } 43 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698