win: Implement SetSkipTaskbar.
This commit is contained in:
		
					parent
					
						
							
								e6998dfd4b
							
						
					
				
			
			
				commit
				
					
						a15ee1871a
					
				
			
		
					 2 changed files with 25 additions and 1 deletions
				
			
		| 
						 | 
					@ -4,6 +4,10 @@
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include "atom/browser/native_window_views.h"
 | 
					#include "atom/browser/native_window_views.h"
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(OS_WIN)
 | 
				
			||||||
 | 
					#include <shobjidl.h>
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
#include <string>
 | 
					#include <string>
 | 
				
			||||||
#include <vector>
 | 
					#include <vector>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -16,6 +20,8 @@
 | 
				
			||||||
#include "content/public/browser/native_web_keyboard_event.h"
 | 
					#include "content/public/browser/native_web_keyboard_event.h"
 | 
				
			||||||
#include "content/public/browser/web_contents_view.h"
 | 
					#include "content/public/browser/web_contents_view.h"
 | 
				
			||||||
#include "native_mate/dictionary.h"
 | 
					#include "native_mate/dictionary.h"
 | 
				
			||||||
 | 
					#include "ui/aura/window.h"
 | 
				
			||||||
 | 
					#include "ui/aura/window_tree_host.h"
 | 
				
			||||||
#include "ui/base/hit_test.h"
 | 
					#include "ui/base/hit_test.h"
 | 
				
			||||||
#include "ui/gfx/image/image.h"
 | 
					#include "ui/gfx/image/image.h"
 | 
				
			||||||
#include "ui/gfx/image/image_skia.h"
 | 
					#include "ui/gfx/image/image_skia.h"
 | 
				
			||||||
| 
						 | 
					@ -30,6 +36,7 @@
 | 
				
			||||||
#include "atom/browser/ui/views/linux_frame_view.h"
 | 
					#include "atom/browser/ui/views/linux_frame_view.h"
 | 
				
			||||||
#elif defined(OS_WIN)
 | 
					#elif defined(OS_WIN)
 | 
				
			||||||
#include "atom/browser/ui/views/win_frame_view.h"
 | 
					#include "atom/browser/ui/views/win_frame_view.h"
 | 
				
			||||||
 | 
					#include "base/win/scoped_comptr.h"
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
namespace atom {
 | 
					namespace atom {
 | 
				
			||||||
| 
						 | 
					@ -92,9 +99,12 @@ NativeWindowViews::NativeWindowViews(content::WebContents* web_contents,
 | 
				
			||||||
    params.remove_standard_frame = true;
 | 
					    params.remove_standard_frame = true;
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					#if defined(USE_X11)
 | 
				
			||||||
 | 
					  // FIXME Find out how to do this dynamically on Linux.
 | 
				
			||||||
  bool skip_taskbar = false;
 | 
					  bool skip_taskbar = false;
 | 
				
			||||||
  if (options.Get(switches::kSkipTaskbar, &skip_taskbar) && skip_taskbar)
 | 
					  if (options.Get(switches::kSkipTaskbar, &skip_taskbar) && skip_taskbar)
 | 
				
			||||||
    params.type = views::Widget::InitParams::TYPE_BUBBLE;
 | 
					    params.type = views::Widget::InitParams::TYPE_BUBBLE;
 | 
				
			||||||
 | 
					#endif
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  window_->Init(params);
 | 
					  window_->Init(params);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -268,7 +278,15 @@ void NativeWindowViews::FlashFrame(bool flash) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NativeWindowViews::SetSkipTaskbar(bool skip) {
 | 
					void NativeWindowViews::SetSkipTaskbar(bool skip) {
 | 
				
			||||||
#if defined(OS_WIN)
 | 
					#if defined(OS_WIN)
 | 
				
			||||||
  // FIXME
 | 
					  base::win::ScopedComPtr<ITaskbarList> taskbar;
 | 
				
			||||||
 | 
					  if (FAILED(taskbar.CreateInstance(CLSID_TaskbarList, NULL,
 | 
				
			||||||
 | 
					                                    CLSCTX_INPROC_SERVER)) ||
 | 
				
			||||||
 | 
					      FAILED(taskbar->HrInit()))
 | 
				
			||||||
 | 
					    return;
 | 
				
			||||||
 | 
					  if (skip)
 | 
				
			||||||
 | 
					    taskbar->DeleteTab(GetAcceleratedWidget());
 | 
				
			||||||
 | 
					  else
 | 
				
			||||||
 | 
					    taskbar->AddTab(GetAcceleratedWidget());
 | 
				
			||||||
#endif
 | 
					#endif
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					@ -315,6 +333,10 @@ gfx::NativeWindow NativeWindowViews::GetNativeWindow() {
 | 
				
			||||||
  return window_->GetNativeWindow();
 | 
					  return window_->GetNativeWindow();
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					gfx::AcceleratedWidget NativeWindowViews::GetAcceleratedWidget() {
 | 
				
			||||||
 | 
					  return GetNativeWindow()->GetHost()->GetAcceleratedWidget();
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
void NativeWindowViews::UpdateDraggableRegions(
 | 
					void NativeWindowViews::UpdateDraggableRegions(
 | 
				
			||||||
    const std::vector<DraggableRegion>& regions) {
 | 
					    const std::vector<DraggableRegion>& regions) {
 | 
				
			||||||
  if (has_frame_)
 | 
					  if (has_frame_)
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
| 
						 | 
					@ -72,6 +72,8 @@ class NativeWindowViews : public NativeWindow,
 | 
				
			||||||
  virtual void SetMenu(ui::MenuModel* menu_model) OVERRIDE;
 | 
					  virtual void SetMenu(ui::MenuModel* menu_model) OVERRIDE;
 | 
				
			||||||
  virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
 | 
					  virtual gfx::NativeWindow GetNativeWindow() OVERRIDE;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  gfx::AcceleratedWidget GetAcceleratedWidget();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
  SkRegion* draggable_region() const { return draggable_region_.get(); }
 | 
					  SkRegion* draggable_region() const { return draggable_region_.get(); }
 | 
				
			||||||
  views::Widget* widget() const { return window_.get(); }
 | 
					  views::Widget* widget() const { return window_.get(); }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue