OLD | NEW |
1 // Copyright (c) 2011 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2011 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/panels/panel_browser_frame_view.h" | 5 #include "chrome/browser/ui/panels/panel_browser_frame_view.h" |
6 | 6 |
7 #include <algorithm> | 7 #include <algorithm> |
8 | 8 |
9 #include "base/utf_string_conversions.h" | 9 #include "base/utf_string_conversions.h" |
10 #include "chrome/browser/themes/theme_service.h" | 10 #include "chrome/browser/themes/theme_service.h" |
(...skipping 352 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
363 window_mask->lineTo(SkIntToScalar(size.width() - 1), 1); | 363 window_mask->lineTo(SkIntToScalar(size.width() - 1), 1); |
364 window_mask->lineTo(SkIntToScalar(size.width() - 1), 2); | 364 window_mask->lineTo(SkIntToScalar(size.width() - 1), 2); |
365 window_mask->lineTo(SkIntToScalar(size.width()), 3); | 365 window_mask->lineTo(SkIntToScalar(size.width()), 3); |
366 window_mask->lineTo(SkIntToScalar(size.width()), | 366 window_mask->lineTo(SkIntToScalar(size.width()), |
367 SkIntToScalar(size.height())); | 367 SkIntToScalar(size.height())); |
368 window_mask->lineTo(0, SkIntToScalar(size.height())); | 368 window_mask->lineTo(0, SkIntToScalar(size.height())); |
369 } | 369 } |
370 window_mask->close(); | 370 window_mask->close(); |
371 } | 371 } |
372 | 372 |
373 void PanelBrowserFrameView::EnableClose(bool enable) { | |
374 close_button_->SetEnabled(enable); | |
375 } | |
376 | |
377 void PanelBrowserFrameView::ResetWindowControls() { | 373 void PanelBrowserFrameView::ResetWindowControls() { |
378 // The close button isn't affected by this constraint. | 374 // The close button isn't affected by this constraint. |
379 } | 375 } |
380 | 376 |
381 void PanelBrowserFrameView::UpdateWindowIcon() { | 377 void PanelBrowserFrameView::UpdateWindowIcon() { |
382 title_icon_->SchedulePaint(); | 378 title_icon_->SchedulePaint(); |
383 } | 379 } |
384 | 380 |
385 void PanelBrowserFrameView::OnPaint(gfx::Canvas* canvas) { | 381 void PanelBrowserFrameView::OnPaint(gfx::Canvas* canvas) { |
386 // The font and color need to be updated depending on the panel's state. | 382 // The font and color need to be updated depending on the panel's state. |
(...skipping 382 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
769 | 765 |
770 settings_menu_model_.reset( | 766 settings_menu_model_.reset( |
771 new PanelSettingsMenuModel(panel_browser_view_->panel())); | 767 new PanelSettingsMenuModel(panel_browser_view_->panel())); |
772 settings_menu_adapter_.reset( | 768 settings_menu_adapter_.reset( |
773 new views::MenuModelAdapter(settings_menu_model_.get())); | 769 new views::MenuModelAdapter(settings_menu_model_.get())); |
774 settings_menu_ = new views::MenuItemView(settings_menu_adapter_.get()); | 770 settings_menu_ = new views::MenuItemView(settings_menu_adapter_.get()); |
775 settings_menu_adapter_->BuildMenu(settings_menu_); | 771 settings_menu_adapter_->BuildMenu(settings_menu_); |
776 settings_menu_runner_.reset(new views::MenuRunner(settings_menu_)); | 772 settings_menu_runner_.reset(new views::MenuRunner(settings_menu_)); |
777 return true; | 773 return true; |
778 } | 774 } |
OLD | NEW |