| 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 "ash/shell/window_type_launcher.h" | 5 #include "ash/shell/window_type_launcher.h" |
| 6 | 6 |
| 7 #include "ash/root_window_controller.h" | 7 #include "ash/root_window_controller.h" |
| 8 #include "ash/screensaver/screensaver_view.h" | 8 #include "ash/screensaver/screensaver_view.h" |
| 9 #include "ash/session/session_state_delegate.h" | 9 #include "ash/session/session_state_delegate.h" |
| 10 #include "ash/shelf/shelf_widget.h" | 10 #include "ash/shelf/shelf_widget.h" |
| (...skipping 58 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 69 views::Widget::CreateWindowWithParent(new ModalWindow(modal_type), | 69 views::Widget::CreateWindowWithParent(new ModalWindow(modal_type), |
| 70 parent); | 70 parent); |
| 71 widget->GetNativeView()->SetName("ModalWindow"); | 71 widget->GetNativeView()->SetName("ModalWindow"); |
| 72 widget->Show(); | 72 widget->Show(); |
| 73 } | 73 } |
| 74 | 74 |
| 75 // Overridden from views::View: | 75 // Overridden from views::View: |
| 76 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 76 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
| 77 canvas->FillRect(GetLocalBounds(), color_); | 77 canvas->FillRect(GetLocalBounds(), color_); |
| 78 } | 78 } |
| 79 virtual gfx::Size GetPreferredSize() OVERRIDE { | 79 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
| 80 return gfx::Size(200, 200); | 80 return gfx::Size(200, 200); |
| 81 } | 81 } |
| 82 virtual void Layout() OVERRIDE { | 82 virtual void Layout() OVERRIDE { |
| 83 gfx::Size open_ps = open_button_->GetPreferredSize(); | 83 gfx::Size open_ps = open_button_->GetPreferredSize(); |
| 84 gfx::Rect local_bounds = GetLocalBounds(); | 84 gfx::Rect local_bounds = GetLocalBounds(); |
| 85 open_button_->SetBounds( | 85 open_button_->SetBounds( |
| 86 5, local_bounds.bottom() - open_ps.height() - 5, | 86 5, local_bounds.bottom() - open_ps.height() - 5, |
| 87 open_ps.width(), open_ps.height()); | 87 open_ps.width(), open_ps.height()); |
| 88 } | 88 } |
| 89 | 89 |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 141 if (non_modal_transient_->IsVisible()) | 141 if (non_modal_transient_->IsVisible()) |
| 142 non_modal_transient_->Hide(); | 142 non_modal_transient_->Hide(); |
| 143 else | 143 else |
| 144 non_modal_transient_->Show(); | 144 non_modal_transient_->Show(); |
| 145 } | 145 } |
| 146 | 146 |
| 147 // Overridden from views::View: | 147 // Overridden from views::View: |
| 148 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { | 148 virtual void OnPaint(gfx::Canvas* canvas) OVERRIDE { |
| 149 canvas->FillRect(GetLocalBounds(), color_); | 149 canvas->FillRect(GetLocalBounds(), color_); |
| 150 } | 150 } |
| 151 virtual gfx::Size GetPreferredSize() OVERRIDE { | 151 virtual gfx::Size GetPreferredSize() const OVERRIDE { |
| 152 return gfx::Size(250, 250); | 152 return gfx::Size(250, 250); |
| 153 } | 153 } |
| 154 | 154 |
| 155 // Overridden from views::WidgetDelegate: | 155 // Overridden from views::WidgetDelegate: |
| 156 virtual views::View* GetContentsView() OVERRIDE { | 156 virtual views::View* GetContentsView() OVERRIDE { |
| 157 return this; | 157 return this; |
| 158 } | 158 } |
| 159 virtual bool CanResize() const OVERRIDE { | 159 virtual bool CanResize() const OVERRIDE { |
| 160 return true; | 160 return true; |
| 161 } | 161 } |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 394 views::MENU_ANCHOR_TOPLEFT, | 394 views::MENU_ANCHOR_TOPLEFT, |
| 395 source_type, | 395 source_type, |
| 396 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == | 396 MenuRunner::HAS_MNEMONICS | views::MenuRunner::CONTEXT_MENU) == |
| 397 MenuRunner::MENU_DELETED) { | 397 MenuRunner::MENU_DELETED) { |
| 398 return; | 398 return; |
| 399 } | 399 } |
| 400 } | 400 } |
| 401 | 401 |
| 402 } // namespace shell | 402 } // namespace shell |
| 403 } // namespace ash | 403 } // namespace ash |
| OLD | NEW |