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

Side by Side Diff: chrome/browser/extensions/api/bookmark_manager_private/bookmark_manager_private_api.cc

Issue 13375017: Move the ViewType enum to extensions\common. (Closed) Base URL: svn://chrome-svn/chrome/trunk/src/
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 | 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/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h" 5 #include "chrome/browser/extensions/api/bookmark_manager_private/bookmark_manage r_private_api.h"
6 6
7 #include <vector> 7 #include <vector>
8 8
9 #include "base/json/json_writer.h" 9 #include "base/json/json_writer.h"
10 #include "base/prefs/pref_service.h" 10 #include "base/prefs/pref_service.h"
(...skipping 384 matching lines...) Expand 10 before | Expand all | Expand 10 after
395 bool BookmarkManagerPrivateStartDragFunction::RunImpl() { 395 bool BookmarkManagerPrivateStartDragFunction::RunImpl() {
396 if (!EditBookmarksEnabled()) 396 if (!EditBookmarksEnabled())
397 return false; 397 return false;
398 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile()); 398 BookmarkModel* model = BookmarkModelFactory::GetForProfile(profile());
399 std::vector<const BookmarkNode*> nodes; 399 std::vector<const BookmarkNode*> nodes;
400 EXTENSION_FUNCTION_VALIDATE( 400 EXTENSION_FUNCTION_VALIDATE(
401 GetNodesFromArguments(model, args_.get(), 0, &nodes)); 401 GetNodesFromArguments(model, args_.get(), 0, &nodes));
402 402
403 WebContents* web_contents = 403 WebContents* web_contents =
404 WebContents::FromRenderViewHost(render_view_host_); 404 WebContents::FromRenderViewHost(render_view_host_);
405 if (chrome::GetViewType(web_contents) == chrome::VIEW_TYPE_TAB_CONTENTS) { 405 if (chrome::GetViewType(web_contents) == extensions::VIEW_TYPE_TAB_CONTENTS) {
Yoyo Zhou 2013/04/01 17:36:51 This is in namespace extensions
406 WebContents* web_contents = 406 WebContents* web_contents =
407 dispatcher()->delegate()->GetAssociatedWebContents(); 407 dispatcher()->delegate()->GetAssociatedWebContents();
408 CHECK(web_contents); 408 CHECK(web_contents);
409 chrome::DragBookmarks(profile(), nodes, 409 chrome::DragBookmarks(profile(), nodes,
410 web_contents->GetView()->GetNativeView()); 410 web_contents->GetView()->GetNativeView());
411 411
412 return true; 412 return true;
413 } else { 413 } else {
414 NOTREACHED(); 414 NOTREACHED();
415 return false; 415 return false;
(...skipping 22 matching lines...) Expand all
438 } 438 }
439 439
440 int drop_index; 440 int drop_index;
441 if (HasOptionalArgument(1)) 441 if (HasOptionalArgument(1))
442 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &drop_index)); 442 EXTENSION_FUNCTION_VALIDATE(args_->GetInteger(1, &drop_index));
443 else 443 else
444 drop_index = drop_parent->child_count(); 444 drop_index = drop_parent->child_count();
445 445
446 WebContents* web_contents = 446 WebContents* web_contents =
447 WebContents::FromRenderViewHost(render_view_host_); 447 WebContents::FromRenderViewHost(render_view_host_);
448 if (chrome::GetViewType(web_contents) == chrome::VIEW_TYPE_TAB_CONTENTS) { 448 if (chrome::GetViewType(web_contents) == extensions::VIEW_TYPE_TAB_CONTENTS) {
449 WebContents* web_contents = 449 WebContents* web_contents =
450 dispatcher()->delegate()->GetAssociatedWebContents(); 450 dispatcher()->delegate()->GetAssociatedWebContents();
451 CHECK(web_contents); 451 CHECK(web_contents);
452 ExtensionWebUI* web_ui = 452 ExtensionWebUI* web_ui =
453 static_cast<ExtensionWebUI*>(web_contents->GetWebUI()->GetController()); 453 static_cast<ExtensionWebUI*>(web_contents->GetWebUI()->GetController());
454 CHECK(web_ui); 454 CHECK(web_ui);
455 BookmarkManagerPrivateEventRouter* router = 455 BookmarkManagerPrivateEventRouter* router =
456 web_ui->bookmark_manager_private_event_router(); 456 web_ui->bookmark_manager_private_event_router();
457 457
458 DCHECK(router); 458 DCHECK(router);
(...skipping 60 matching lines...) Expand 10 before | Expand all | Expand 10 after
519 #if defined(OS_WIN) 519 #if defined(OS_WIN)
520 if (win8::IsSingleWindowMetroMode()) 520 if (win8::IsSingleWindowMetroMode())
521 can_open_new_windows = false; 521 can_open_new_windows = false;
522 #endif // OS_WIN 522 #endif // OS_WIN
523 523
524 SetResult(new base::FundamentalValue(can_open_new_windows)); 524 SetResult(new base::FundamentalValue(can_open_new_windows));
525 return true; 525 return true;
526 } 526 }
527 527
528 } // namespace extensions 528 } // namespace extensions
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698