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

Side by Side Diff: chrome/browser/ui/views/extensions/shell_window_views.cc

Issue 11363250: Allow Chrome apps to create Ash Panels (apps v2) (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Multi-icon support Created 8 years, 1 month 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 "chrome/browser/ui/views/extensions/shell_window_views.h" 5 #include "chrome/browser/ui/views/extensions/shell_window_views.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "chrome/browser/extensions/extension_host.h" 8 #include "chrome/browser/extensions/extension_host.h"
9 #include "chrome/browser/favicon/favicon_tab_helper.h" 9 #include "chrome/browser/favicon/favicon_tab_helper.h"
10 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views .h" 10 #include "chrome/browser/ui/views/extensions/extension_keybinding_registry_views .h"
(...skipping 23 matching lines...) Expand all
34 #if defined(OS_WIN) && !defined(USE_AURA) 34 #if defined(OS_WIN) && !defined(USE_AURA)
35 #include "chrome/browser/shell_integration.h" 35 #include "chrome/browser/shell_integration.h"
36 #include "chrome/browser/web_applications/web_app.h" 36 #include "chrome/browser/web_applications/web_app.h"
37 #include "ui/base/win/shell.h" 37 #include "ui/base/win/shell.h"
38 #endif 38 #endif
39 39
40 #if defined(USE_ASH) 40 #if defined(USE_ASH)
41 #include "ash/ash_constants.h" 41 #include "ash/ash_constants.h"
42 #include "ash/wm/custom_frame_view_ash.h" 42 #include "ash/wm/custom_frame_view_ash.h"
43 #include "chrome/browser/ui/ash/ash_util.h" 43 #include "chrome/browser/ui/ash/ash_util.h"
44 #include "chrome/browser/ui/ash/shell_utility_window_ash.h"
44 #include "ui/aura/env.h" 45 #include "ui/aura/env.h"
45 #include "ui/aura/window.h" 46 #include "ui/aura/window.h"
46 #endif 47 #endif
47 48
48 namespace { 49 namespace {
49 const int kResizeInsideBoundsSize = 5; 50 const int kResizeInsideBoundsSize = 5;
50 const int kResizeAreaCornerSize = 16; 51 const int kResizeAreaCornerSize = 16;
51 52
52 // Height of the chrome-style caption, in pixels. 53 // Height of the chrome-style caption, in pixels.
53 const int kCaptionHeight = 25; 54 const int kCaptionHeight = 25;
(...skipping 339 matching lines...) Expand 10 before | Expand all | Expand 10 after
393 frame_->Restore(); 394 frame_->Restore();
394 else if (sender == minimize_button_) 395 else if (sender == minimize_button_)
395 frame_->Minimize(); 396 frame_->Minimize();
396 } 397 }
397 398
398 ShellWindowViews::ShellWindowViews(ShellWindow* shell_window, 399 ShellWindowViews::ShellWindowViews(ShellWindow* shell_window,
399 const ShellWindow::CreateParams& win_params) 400 const ShellWindow::CreateParams& win_params)
400 : shell_window_(shell_window), 401 : shell_window_(shell_window),
401 web_view_(NULL), 402 web_view_(NULL),
402 is_fullscreen_(false), 403 is_fullscreen_(false),
403 frameless_(win_params.frame == ShellWindow::CreateParams::FRAME_NONE) { 404 frameless_(win_params.frame == ShellWindow::FRAME_NONE) {
404 window_ = new views::Widget; 405 window_ = new views::Widget;
405 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW); 406 views::Widget::InitParams params(views::Widget::InitParams::TYPE_WINDOW);
406 params.delegate = this; 407 params.delegate = this;
407 params.remove_standard_frame = true; 408 params.remove_standard_frame = true;
408 params.use_system_default_icon = true; 409 params.use_system_default_icon = true;
409 minimum_size_ = win_params.minimum_size; 410 minimum_size_ = win_params.minimum_size;
410 maximum_size_ = win_params.maximum_size; 411 maximum_size_ = win_params.maximum_size;
411 window_->Init(params); 412 window_->Init(params);
412 gfx::Rect window_bounds = 413 gfx::Rect window_bounds =
413 window_->non_client_view()->GetWindowBoundsForClientBounds( 414 window_->non_client_view()->GetWindowBoundsForClientBounds(
(...skipping 318 matching lines...) Expand 10 before | Expand all | Expand 10 after
732 733
733 void ShellWindowViews::SaveWindowPlacement(const gfx::Rect& bounds, 734 void ShellWindowViews::SaveWindowPlacement(const gfx::Rect& bounds,
734 ui::WindowShowState show_state) { 735 ui::WindowShowState show_state) {
735 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state); 736 views::WidgetDelegate::SaveWindowPlacement(bounds, show_state);
736 shell_window_->SaveWindowPosition(); 737 shell_window_->SaveWindowPosition();
737 } 738 }
738 739
739 // static 740 // static
740 NativeShellWindow* NativeShellWindow::Create( 741 NativeShellWindow* NativeShellWindow::Create(
741 ShellWindow* shell_window, const ShellWindow::CreateParams& params) { 742 ShellWindow* shell_window, const ShellWindow::CreateParams& params) {
743 #if defined(USE_ASH)
744 if (params.window_type == ShellWindow::WINDOW_TYPE_PANEL)
745 return new ShellUtilityWindowAsh(shell_window, params);
746 #endif
742 return new ShellWindowViews(shell_window, params); 747 return new ShellWindowViews(shell_window, params);
743 } 748 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698