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 "ui/app_list/views/app_list_view.h" | 5 #include "ui/app_list/views/app_list_view.h" |
| 6 | 6 |
| 7 #include <algorithm> | 7 #include <algorithm> |
| 8 | 8 |
| 9 #include "base/command_line.h" | 9 #include "base/command_line.h" |
| 10 #include "base/metrics/histogram.h" | 10 #include "base/metrics/histogram.h" |
| (...skipping 273 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 284 } | 284 } |
| 285 | 285 |
| 286 void AppListView::OnShutdown() { | 286 void AppListView::OnShutdown() { |
| 287 // Nothing to do on views - the widget will soon be closed, which will tear | 287 // Nothing to do on views - the widget will soon be closed, which will tear |
| 288 // everything down. | 288 // everything down. |
| 289 } | 289 } |
| 290 | 290 |
| 291 void AppListView::SetProfileByPath(const base::FilePath& profile_path) { | 291 void AppListView::SetProfileByPath(const base::FilePath& profile_path) { |
| 292 delegate_->SetProfileByPath(profile_path); | 292 delegate_->SetProfileByPath(profile_path); |
| 293 app_list_main_view_->ModelChanged(); | 293 app_list_main_view_->ModelChanged(); |
| 294 | |
| 295 if (delegate_) | |
| 296 delegate_->ViewReinitializedForProfileChange(); | |
| 294 } | 297 } |
| 295 | 298 |
| 296 void AppListView::AddObserver(AppListViewObserver* observer) { | 299 void AppListView::AddObserver(AppListViewObserver* observer) { |
| 297 observers_.AddObserver(observer); | 300 observers_.AddObserver(observer); |
| 298 } | 301 } |
| 299 | 302 |
| 300 void AppListView::RemoveObserver(AppListViewObserver* observer) { | 303 void AppListView::RemoveObserver(AppListViewObserver* observer) { |
| 301 observers_.RemoveObserver(observer); | 304 observers_.RemoveObserver(observer); |
| 302 } | 305 } |
| 303 | 306 |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 413 // On platforms that don't support a shadow, the rounded border of the app | 416 // On platforms that don't support a shadow, the rounded border of the app |
| 414 // list is constructed _inside_ the view, so a rectangular background goes | 417 // list is constructed _inside_ the view, so a rectangular background goes |
| 415 // over the border in the rounded corners. To fix this, give the background a | 418 // over the border in the rounded corners. To fix this, give the background a |
| 416 // corner radius 1px smaller than the outer border, so it just reaches but | 419 // corner radius 1px smaller than the outer border, so it just reaches but |
| 417 // doesn't cover it. | 420 // doesn't cover it. |
| 418 const int kOverlayCornerRadius = | 421 const int kOverlayCornerRadius = |
| 419 GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius(); | 422 GetBubbleFrameView()->bubble_border()->GetBorderCornerRadius(); |
| 420 overlay_view_->set_background(new AppListOverlayBackground( | 423 overlay_view_->set_background(new AppListOverlayBackground( |
| 421 kOverlayCornerRadius - (SupportsShadow() ? 0 : 1))); | 424 kOverlayCornerRadius - (SupportsShadow() ? 0 : 1))); |
| 422 AddChildView(overlay_view_); | 425 AddChildView(overlay_view_); |
| 423 | 426 |
|
Matt Giuca
2014/11/03 00:57:42
Why did this go away?
calamity
2014/11/06 02:36:32
It's back. From outer space.
| |
| 424 if (delegate_) | |
| 425 delegate_->ViewInitialized(); | |
| 426 | |
| 427 UMA_HISTOGRAM_TIMES("Apps.AppListCreationTime", | 427 UMA_HISTOGRAM_TIMES("Apps.AppListCreationTime", |
| 428 base::Time::Now() - start_time); | 428 base::Time::Now() - start_time); |
| 429 } | 429 } |
| 430 | 430 |
| 431 void AppListView::OnBeforeBubbleWidgetInit( | 431 void AppListView::OnBeforeBubbleWidgetInit( |
| 432 views::Widget::InitParams* params, | 432 views::Widget::InitParams* params, |
| 433 views::Widget* widget) const { | 433 views::Widget* widget) const { |
| 434 #if defined(USE_AURA) && !defined(OS_CHROMEOS) | 434 #if defined(USE_AURA) && !defined(OS_CHROMEOS) |
| 435 if (delegate_ && delegate_->ForceNativeDesktop()) | 435 if (delegate_ && delegate_->ForceNativeDesktop()) |
| 436 params->native_widget = new views::DesktopNativeWidgetAura(widget); | 436 params->native_widget = new views::DesktopNativeWidgetAura(widget); |
| (...skipping 169 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 606 speech_view_->layer()->SetTransform(speech_transform); | 606 speech_view_->layer()->SetTransform(speech_transform); |
| 607 } | 607 } |
| 608 | 608 |
| 609 if (will_appear) | 609 if (will_appear) |
| 610 speech_view_->SetVisible(true); | 610 speech_view_->SetVisible(true); |
| 611 else | 611 else |
| 612 app_list_main_view_->SetVisible(true); | 612 app_list_main_view_->SetVisible(true); |
| 613 } | 613 } |
| 614 | 614 |
| 615 } // namespace app_list | 615 } // namespace app_list |
| OLD | NEW |