Chromium Code Reviews| OLD | NEW |
|---|---|
| 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_view.h" | 5 #include "chrome/browser/ui/views/location_bar/location_bar_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 #include <map> | 8 #include <map> |
| 9 | 9 |
| 10 #include "base/command_line.h" | 10 #include "base/command_line.h" |
| (...skipping 293 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 304 AddChildView(web_intents_button_view_); | 304 AddChildView(web_intents_button_view_); |
| 305 | 305 |
| 306 if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { | 306 if (browser_defaults::bookmarks_enabled && (mode_ == NORMAL)) { |
| 307 // Note: condition above means that the star icon is hidden in popups and in | 307 // Note: condition above means that the star icon is hidden in popups and in |
| 308 // the app launcher. | 308 // the app launcher. |
| 309 star_view_ = new StarView(command_updater_); | 309 star_view_ = new StarView(command_updater_); |
| 310 AddChildView(star_view_); | 310 AddChildView(star_view_); |
| 311 star_view_->SetVisible(true); | 311 star_view_->SetVisible(true); |
| 312 } | 312 } |
| 313 if (extensions::switch_utils::IsActionBoxEnabled() && browser_) { | 313 if (extensions::switch_utils::IsActionBoxEnabled() && browser_) { |
| 314 action_box_button_view_ = new ActionBoxButtonView(browser_); | 314 gfx::Point menu_offset( |
|
Peter Kasting
2012/09/14 22:50:53
Nit: I would probably inline this into the next st
yefimt
2012/09/14 23:00:56
I always felt that N one line expressions are more
| |
| 315 (mode_ == NORMAL) ? kNormalHorizontalEdgeThickness : 0, | |
| 316 kVerticalEdgeThickness); | |
| 317 action_box_button_view_ = new ActionBoxButtonView(browser_, menu_offset); | |
| 315 AddChildView(action_box_button_view_); | 318 AddChildView(action_box_button_view_); |
| 319 | |
| 316 if (star_view_) | 320 if (star_view_) |
| 317 star_view_->SetVisible(false); | 321 star_view_->SetVisible(false); |
| 318 } | 322 } |
| 319 | 323 |
| 320 registrar_.Add(this, | 324 registrar_.Add(this, |
| 321 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, | 325 chrome::NOTIFICATION_EXTENSION_LOCATION_BAR_UPDATED, |
| 322 content::Source<Profile>(profile_)); | 326 content::Source<Profile>(profile_)); |
| 323 | 327 |
| 324 // Initialize the location entry. We do this to avoid a black flash which is | 328 // Initialize the location entry. We do this to avoid a black flash which is |
| 325 // visible when the location entry has just been initialized. | 329 // visible when the location entry has just been initialized. |
| (...skipping 1225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1551 } | 1555 } |
| 1552 | 1556 |
| 1553 void LocationBarView::CleanupFadeAnimation() { | 1557 void LocationBarView::CleanupFadeAnimation() { |
| 1554 // Since we're no longer animating we don't need our layer. | 1558 // Since we're no longer animating we don't need our layer. |
| 1555 SetPaintToLayer(false); | 1559 SetPaintToLayer(false); |
| 1556 // Bubble labels don't need a transparent background anymore. | 1560 // Bubble labels don't need a transparent background anymore. |
| 1557 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1561 ev_bubble_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1558 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); | 1562 selected_keyword_view_->SetLabelBackgroundColor(SK_ColorWHITE); |
| 1559 } | 1563 } |
| 1560 #endif // USE_AURA | 1564 #endif // USE_AURA |
| OLD | NEW |