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

Side by Side Diff: chrome/browser/ui/extensions/shell_window.cc

Issue 13150004: Support color chooser inside extesions, apps, chrome frame, dev tool (Closed) Base URL: http://git.chromium.org/chromium/src.git@ngcolor
Patch Set: Created 7 years, 8 months 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
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/extensions/shell_window.h" 5 #include "chrome/browser/ui/extensions/shell_window.h"
6 6
7 #include "base/utf_string_conversions.h" 7 #include "base/utf_string_conversions.h"
8 #include "base/values.h" 8 #include "base/values.h"
9 #include "chrome/browser/extensions/app_window_contents.h" 9 #include "chrome/browser/extensions/app_window_contents.h"
10 #include "chrome/browser/extensions/extension_process_manager.h" 10 #include "chrome/browser/extensions/extension_process_manager.h"
11 #include "chrome/browser/extensions/extension_system.h" 11 #include "chrome/browser/extensions/extension_system.h"
12 #include "chrome/browser/extensions/image_loader.h" 12 #include "chrome/browser/extensions/image_loader.h"
13 #include "chrome/browser/extensions/shell_window_geometry_cache.h" 13 #include "chrome/browser/extensions/shell_window_geometry_cache.h"
14 #include "chrome/browser/extensions/shell_window_registry.h" 14 #include "chrome/browser/extensions/shell_window_registry.h"
15 #include "chrome/browser/extensions/suggest_permission_util.h" 15 #include "chrome/browser/extensions/suggest_permission_util.h"
16 #include "chrome/browser/favicon/favicon_tab_helper.h" 16 #include "chrome/browser/favicon/favicon_tab_helper.h"
17 #include "chrome/browser/file_select_helper.h" 17 #include "chrome/browser/file_select_helper.h"
18 #include "chrome/browser/lifetime/application_lifetime.h" 18 #include "chrome/browser/lifetime/application_lifetime.h"
19 #include "chrome/browser/media/media_capture_devices_dispatcher.h" 19 #include "chrome/browser/media/media_capture_devices_dispatcher.h"
20 #include "chrome/browser/profiles/profile.h" 20 #include "chrome/browser/profiles/profile.h"
21 #include "chrome/browser/sessions/session_id.h" 21 #include "chrome/browser/sessions/session_id.h"
22 #include "chrome/browser/ui/browser.h" 22 #include "chrome/browser/ui/browser.h"
23 #include "chrome/browser/ui/browser_finder.h" 23 #include "chrome/browser/ui/browser_finder.h"
24 #include "chrome/browser/ui/browser_tabstrip.h" 24 #include "chrome/browser/ui/browser_tabstrip.h"
25 #include "chrome/browser/ui/browser_window.h" 25 #include "chrome/browser/ui/browser_window.h"
26 #include "chrome/browser/ui/color_chooser_controller.h"
26 #include "chrome/browser/ui/extensions/native_app_window.h" 27 #include "chrome/browser/ui/extensions/native_app_window.h"
27 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h" 28 #include "chrome/browser/ui/web_contents_modal_dialog_manager.h"
28 #include "chrome/browser/view_type_utils.h" 29 #include "chrome/browser/view_type_utils.h"
29 #include "chrome/common/chrome_notification_types.h" 30 #include "chrome/common/chrome_notification_types.h"
30 #include "chrome/common/extensions/api/icons/icons_handler.h" 31 #include "chrome/common/extensions/api/icons/icons_handler.h"
31 #include "chrome/common/extensions/extension.h" 32 #include "chrome/common/extensions/extension.h"
32 #include "chrome/common/extensions/extension_constants.h" 33 #include "chrome/common/extensions/extension_constants.h"
33 #include "chrome/common/extensions/extension_messages.h" 34 #include "chrome/common/extensions/extension_messages.h"
34 #include "chrome/common/extensions/request_media_access_permission_helper.h" 35 #include "chrome/common/extensions/request_media_access_permission_helper.h"
35 #include "content/public/browser/invalidate_type.h" 36 #include "content/public/browser/invalidate_type.h"
(...skipping 387 matching lines...) Expand 10 before | Expand all | Expand 10 after
423 } 424 }
424 425
425 void ShellWindow::CloseContents(WebContents* contents) { 426 void ShellWindow::CloseContents(WebContents* contents) {
426 native_app_window_->Close(); 427 native_app_window_->Close();
427 } 428 }
428 429
429 bool ShellWindow::ShouldSuppressDialogs() { 430 bool ShellWindow::ShouldSuppressDialogs() {
430 return true; 431 return true;
431 } 432 }
432 433
434 content::ColorChooser* ShellWindow::OpenColorChooser(WebContents* web_contents,
435 int color_chooser_id,
436 SkColor color) {
437 return ColorChooserController::GetInstance()->OpenColorChooser(
438 color, web_contents, color_chooser_id);
439 }
440
433 void ShellWindow::RunFileChooser(WebContents* tab, 441 void ShellWindow::RunFileChooser(WebContents* tab,
434 const content::FileChooserParams& params) { 442 const content::FileChooserParams& params) {
435 FileSelectHelper::RunFileChooser(tab, params); 443 FileSelectHelper::RunFileChooser(tab, params);
436 } 444 }
437 445
438 bool ShellWindow::IsPopupOrPanel(const WebContents* source) const { 446 bool ShellWindow::IsPopupOrPanel(const WebContents* source) const {
439 return true; 447 return true;
440 } 448 }
441 449
442 void ShellWindow::MoveContents(WebContents* source, const gfx::Rect& pos) { 450 void ShellWindow::MoveContents(WebContents* source, const gfx::Rect& pos) {
(...skipping 89 matching lines...) Expand 10 before | Expand all | Expand 10 after
532 const extensions::DraggableRegion& region = *iter; 540 const extensions::DraggableRegion& region = *iter;
533 sk_region->op( 541 sk_region->op(
534 region.bounds.x(), 542 region.bounds.x(),
535 region.bounds.y(), 543 region.bounds.y(),
536 region.bounds.right(), 544 region.bounds.right(),
537 region.bounds.bottom(), 545 region.bounds.bottom(),
538 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op); 546 region.draggable ? SkRegion::kUnion_Op : SkRegion::kDifference_Op);
539 } 547 }
540 return sk_region; 548 return sk_region;
541 } 549 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698