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

Side by Side Diff: ash/shelf/shelf_widget.cc

Issue 286733002: [Refactor] Consolidate the logic for whether a widget can be activated. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 7 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 "ash/shelf/shelf_widget.h" 5 #include "ash/shelf/shelf_widget.h"
6 6
7 #include "ash/ash_switches.h" 7 #include "ash/ash_switches.h"
8 #include "ash/focus_cycler.h" 8 #include "ash/focus_cycler.h"
9 #include "ash/root_window_controller.h" 9 #include "ash/root_window_controller.h"
10 #include "ash/session/session_state_delegate.h" 10 #include "ash/session/session_state_delegate.h"
(...skipping 403 matching lines...) Expand 10 before | Expand all | Expand 10 after
414 414
415 void ShelfWidget::DelegateView::SetDimmed(bool value) { 415 void ShelfWidget::DelegateView::SetDimmed(bool value) {
416 if (value == (dimmer_.get() != NULL)) 416 if (value == (dimmer_.get() != NULL))
417 return; 417 return;
418 418
419 if (value) { 419 if (value) {
420 dimmer_.reset(new views::Widget); 420 dimmer_.reset(new views::Widget);
421 views::Widget::InitParams params( 421 views::Widget::InitParams params(
422 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS); 422 views::Widget::InitParams::TYPE_WINDOW_FRAMELESS);
423 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW; 423 params.opacity = views::Widget::InitParams::TRANSLUCENT_WINDOW;
424 params.can_activate = false; 424 params.activatable = views::Widget::InitParams::ACTIVATABLE_NO;
425 params.accept_events = false; 425 params.accept_events = false;
426 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET; 426 params.ownership = views::Widget::InitParams::WIDGET_OWNS_NATIVE_WIDGET;
427 params.parent = shelf_->GetNativeView(); 427 params.parent = shelf_->GetNativeView();
428 dimmer_->Init(params); 428 dimmer_->Init(params);
429 dimmer_->GetNativeWindow()->SetName("ShelfDimmer"); 429 dimmer_->GetNativeWindow()->SetName("ShelfDimmer");
430 dimmer_->SetBounds(shelf_->GetWindowBoundsInScreen()); 430 dimmer_->SetBounds(shelf_->GetWindowBoundsInScreen());
431 // The shelf should not take focus when it is initially shown. 431 // The shelf should not take focus when it is initially shown.
432 dimmer_->set_focus_on_creation(false); 432 dimmer_->set_focus_on_creation(false);
433 dimmer_view_ = new DimmerView(shelf_, disable_dimming_animations_for_test_); 433 dimmer_view_ = new DimmerView(shelf_, disable_dimming_animations_for_test_);
434 dimmer_->SetContentsView(dimmer_view_); 434 dimmer_->SetContentsView(dimmer_view_);
(...skipping 366 matching lines...) Expand 10 before | Expand all | Expand 10 after
801 DCHECK(delegate_view_); 801 DCHECK(delegate_view_);
802 return delegate_view_->disable_dimming_animations_for_test(); 802 return delegate_view_->disable_dimming_animations_for_test();
803 } 803 }
804 804
805 void ShelfWidget::WillDeleteShelf() { 805 void ShelfWidget::WillDeleteShelf() {
806 shelf_layout_manager_->RemoveObserver(this); 806 shelf_layout_manager_->RemoveObserver(this);
807 shelf_layout_manager_ = NULL; 807 shelf_layout_manager_ = NULL;
808 } 808 }
809 809
810 } // namespace ash 810 } // namespace ash
OLDNEW
« no previous file with comments | « ash/magnifier/partial_magnification_controller.cc ('k') | ash/sticky_keys/sticky_keys_overlay.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698