| 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/panels/panel_view.h" | 5 #include "chrome/browser/ui/panels/panel_view.h" |
| 6 | 6 |
| 7 #include <map> | 7 #include <map> |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "chrome/app/chrome_command_ids.h" | 9 #include "chrome/app/chrome_command_ids.h" |
| 10 #include "chrome/browser/ui/panels/panel.h" | 10 #include "chrome/browser/ui/panels/panel.h" |
| (...skipping 286 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 297 | 297 |
| 298 void PanelView::UpdatePanelTitleBar() { | 298 void PanelView::UpdatePanelTitleBar() { |
| 299 UpdateWindowTitle(); | 299 UpdateWindowTitle(); |
| 300 UpdateWindowIcon(); | 300 UpdateWindowIcon(); |
| 301 } | 301 } |
| 302 | 302 |
| 303 void PanelView::UpdatePanelLoadingAnimations(bool should_animate) { | 303 void PanelView::UpdatePanelLoadingAnimations(bool should_animate) { |
| 304 GetFrameView()->UpdateThrobber(); | 304 GetFrameView()->UpdateThrobber(); |
| 305 } | 305 } |
| 306 | 306 |
| 307 FindBar* PanelView::CreatePanelFindBar() { | |
| 308 NOTREACHED(); // legacy API from browser window. N/A for refactored panels. | |
| 309 return NULL; | |
| 310 } | |
| 311 | |
| 312 void PanelView::NotifyPanelOnUserChangedTheme() { | 307 void PanelView::NotifyPanelOnUserChangedTheme() { |
| 313 GetFrameView()->SchedulePaint(); | 308 GetFrameView()->SchedulePaint(); |
| 314 } | 309 } |
| 315 | 310 |
| 316 void PanelView::PanelWebContentsFocused(content::WebContents* contents) { | 311 void PanelView::PanelWebContentsFocused(content::WebContents* contents) { |
| 317 web_view_->OnWebContentsFocused(contents); | 312 web_view_->OnWebContentsFocused(contents); |
| 318 } | 313 } |
| 319 | 314 |
| 320 void PanelView::PanelCut() { | 315 void PanelView::PanelCut() { |
| 321 // Nothing to do since we do not have panel-specific system menu. | 316 // Nothing to do since we do not have panel-specific system menu. |
| (...skipping 19 matching lines...) Expand all Loading... |
| 341 GetFrameView()->SchedulePaint(); | 336 GetFrameView()->SchedulePaint(); |
| 342 | 337 |
| 343 if ((panel_->attention_mode() & Panel::USE_SYSTEM_ATTENTION) != 0) | 338 if ((panel_->attention_mode() & Panel::USE_SYSTEM_ATTENTION) != 0) |
| 344 window_->FlashFrame(draw_attention); | 339 window_->FlashFrame(draw_attention); |
| 345 } | 340 } |
| 346 | 341 |
| 347 bool PanelView::IsDrawingAttention() const { | 342 bool PanelView::IsDrawingAttention() const { |
| 348 return is_drawing_attention_; | 343 return is_drawing_attention_; |
| 349 } | 344 } |
| 350 | 345 |
| 351 bool PanelView::PreHandlePanelKeyboardEvent( | |
| 352 const content::NativeWebKeyboardEvent& event, | |
| 353 bool* is_keyboard_shortcut) { | |
| 354 return false; | |
| 355 } | |
| 356 | |
| 357 void PanelView::HandlePanelKeyboardEvent( | 346 void PanelView::HandlePanelKeyboardEvent( |
| 358 const content::NativeWebKeyboardEvent& event) { | 347 const content::NativeWebKeyboardEvent& event) { |
| 359 views::FocusManager* focus_manager = GetFocusManager(); | 348 views::FocusManager* focus_manager = GetFocusManager(); |
| 360 if (focus_manager->shortcut_handling_suspended()) | 349 if (focus_manager->shortcut_handling_suspended()) |
| 361 return; | 350 return; |
| 362 | 351 |
| 363 ui::Accelerator accelerator( | 352 ui::Accelerator accelerator( |
| 364 static_cast<ui::KeyboardCode>(event.windowsKeyCode), | 353 static_cast<ui::KeyboardCode>(event.windowsKeyCode), |
| 365 content::GetModifiersFromNativeWebKeyboardEvent(event)); | 354 content::GetModifiersFromNativeWebKeyboardEvent(event)); |
| 366 if (event.type == WebKit::WebInputEvent::KeyUp) | 355 if (event.type == WebKit::WebInputEvent::KeyUp) |
| 367 accelerator.set_type(ui::ET_KEY_RELEASED); | 356 accelerator.set_type(ui::ET_KEY_RELEASED); |
| 368 focus_manager->ProcessAccelerator(accelerator); | 357 focus_manager->ProcessAccelerator(accelerator); |
| 369 } | 358 } |
| 370 | 359 |
| 371 void PanelView::FullScreenModeChanged(bool is_full_screen) { | 360 void PanelView::FullScreenModeChanged(bool is_full_screen) { |
| 372 if (is_full_screen) { | 361 if (is_full_screen) { |
| 373 if (window_->IsVisible()) | 362 if (window_->IsVisible()) |
| 374 window_->Hide(); | 363 window_->Hide(); |
| 375 } else { | 364 } else { |
| 376 ShowPanelInactive(); | 365 ShowPanelInactive(); |
| 377 } | 366 } |
| 378 } | 367 } |
| 379 | 368 |
| 380 Browser* PanelView::GetPanelBrowser() const { | |
| 381 NOTREACHED(); // legacy API from BrowserWindow. N/A for refactored panels. | |
| 382 return NULL; | |
| 383 } | |
| 384 | |
| 385 void PanelView::EnsurePanelFullyVisible() { | |
| 386 // This method is going to be removed. | |
| 387 } | |
| 388 | |
| 389 void PanelView::SetPanelAlwaysOnTop(bool on_top) { | 369 void PanelView::SetPanelAlwaysOnTop(bool on_top) { |
| 390 window_->SetAlwaysOnTop(on_top); | 370 window_->SetAlwaysOnTop(on_top); |
| 391 window_->non_client_view()->Layout(); | 371 window_->non_client_view()->Layout(); |
| 392 window_->client_view()->Layout(); | 372 window_->client_view()->Layout(); |
| 393 } | 373 } |
| 394 | 374 |
| 395 void PanelView::EnableResizeByMouse(bool enable) { | 375 void PanelView::EnableResizeByMouse(bool enable) { |
| 396 // Nothing to do since we use system resizing. | 376 // Nothing to do since we use system resizing. |
| 397 } | 377 } |
| 398 | 378 |
| (...skipping 345 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 744 int height = web_view_->size().height(); | 724 int height = web_view_->size().height(); |
| 745 SkRegion* region = new SkRegion; | 725 SkRegion* region = new SkRegion; |
| 746 region->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); | 726 region->op(0, 0, kResizeInsideBoundsSize, height, SkRegion::kUnion_Op); |
| 747 region->op(width - kResizeInsideBoundsSize, 0, width, height, | 727 region->op(width - kResizeInsideBoundsSize, 0, width, height, |
| 748 SkRegion::kUnion_Op); | 728 SkRegion::kUnion_Op); |
| 749 region->op(0, height - kResizeInsideBoundsSize, width, height, | 729 region->op(0, height - kResizeInsideBoundsSize, width, height, |
| 750 SkRegion::kUnion_Op); | 730 SkRegion::kUnion_Op); |
| 751 web_contents->GetRenderViewHost()->GetView()->SetClickthroughRegion(region); | 731 web_contents->GetRenderViewHost()->GetView()->SetClickthroughRegion(region); |
| 752 #endif | 732 #endif |
| 753 } | 733 } |
| OLD | NEW |